Loading...
question swiftui March 6, 2023 How to render the icon on a menu bar as a template in SwiftUI?

Setting your app’s icon on the menu bar as a template makes it to adapt to light and dark modes automatically without you doing anything. To do this, you have to use this constructor of MenuBarExtra class.

question swift swiftui May 29, 2022 How to open a new window in SwiftUI?

Although many things in SwiftUI are idiomatic and straightforward, showing your view in a new window needs a bit of coding to do. Hence, this short post.

question macOS swift November 10, 2021 How to detect fn key press in Swift?

You can override the flagsChanged() method of NSViewController and have your code like below to detect fn key press and release in macOS:

question swift March 14, 2021 How to generate a random number in Swift?

You can use the random method in Int struct for this.

question macOS swift March 14, 2021 How to ignore mouse events in a view or window in macOS?

You can ignore mouse events in a window/view by adding just a single line of code.

question macOS swift March 14, 2021 How to detect Escape key pressed in macOS apps?

Like Delete key, detection of Escape key press is also slightly different than detecting general key presses.

question presentify November 8, 2020 Presentify not working with Zoom or other video calling apps?

To use Presentify with any video conference apps, like Zoom, Teams, etc. you have to select the entire screen while sharing instead of a single app (or window) as shown below:

question chromium devtips August 27, 2020 How to take screenshots of the entire webpage without any extensions?

I always used an extension like Awesome Screenshot in Chrome to take screenshots of any website. However, you do not need an extension to capture a screenshot of a webpage.

question mac August 24, 2020 How to solve Black Screen Issue with Brave and Chrome browsers on macOS?

I have been facing this issue lately with Brave browser and after some digging, I learned that it has something to do with GPUs. Disabling ‘Use hardware acceleration when available’ option resolved the issue for me.

question macOS swift August 14, 2020 How to quit or close an app in macOS using Swift?

You can quit or exit an app with:NSApp.terminate(self)

question macOS swift August 14, 2020 How to detect Delete key press in Swift?

Delete key press detection is slightly different than other keys. It uses NSDeleteCharacter like below:

question swift xcode August 12, 2020 How to remove a Swift package from a project in Xcode?

If you go to Xcode > File > Swift Packages, you can see options to add a new Swift package, update them, reset caches, and resolve package versions. However, you do not see an option to remove a particular Swift package.

question liquid jekyll August 11, 2020 How to escape Liquid template code in a Jekyll website?

We know that Jekyll uses Liquid as its templating language. This means all your Liquid code will be executed by Jekyllby default.

question liquid August 11, 2020 How to create an array in Liquid?

The official doc of Liquid doesn’t tell us a way tocreate an array except this:

question liquid August 11, 2020 How to check if a string is blank in Liquid?

I read the official docs of Liquid but couldn’t findthe info that I was looking for.

question swift August 9, 2020 How to iterate an array in reverse in Swift?

From Swift 5.0, you can use any of the following approaches to iterate an array in reverse.

question java August 9, 2020 How to create a Singleton in Java?

Singleton means only one instance of a class can exist in the system at any given time.

question presentify mac August 6, 2020 How to annotate or draw in JioMeet?

Reliance Jio has done a commendable job releasing a video conferencing app in a short time frame, however, it received criticisms that it copied pixel by pixel from Zoom. I actually agree with some of the criticisms but that’s for another blog post.

question macOS swift August 6, 2020 How to open an app's window on top of all others in Swift?

You can open your app’s window on top of all other open application windows with the below code:

question macOS swift August 6, 2020 How to keep an app's window always on top of others in Swift?

Before launching the window, just use the appropriate window level, and you’re done.