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.
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.
You can override the flagsChanged() method of NSViewController and have your code like below to detect fn key press and release in macOS:
You can use the random method in Int struct for this.
You can ignore mouse events in a window/view by adding just a single line of code.
Like Delete key, detection of Escape key press is also slightly different than detecting general key presses.
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:
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.
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.
You can quit or exit an app with:NSApp.terminate(self)
Delete key press detection is slightly different than other keys. It uses NSDeleteCharacter like below:
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.
We know that Jekyll uses Liquid as its templating language. This means all your Liquid code will be executed by Jekyllby default.
The official doc of Liquid doesn’t tell us a way tocreate an array except this:
I read the official docs of Liquid but couldn’t findthe info that I was looking for.
From Swift 5.0, you can use any of the following approaches to iterate an array in reverse.
Singleton means only one instance of a class can exist in the system at any given time.
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.
You can open your app’s window on top of all other open application windows with the below code:
Before launching the window, just use the appropriate window level, and you’re done.