Post

Replies

Boosts

Views

Activity

Reply to Any advices for a new kid coming to Apple development?
I can't really answer your specific questions, but I would remark that macOS has multiple layers coming from different eras, somewhat like an archeological dig. Some of the newest APIs can only be used with Apple's new favorite language, Swift. Dig a little deeper and you find lots of APIs designed for use with Objective-C (though they can be used with Swift too.) Below that, there are POSIX APIs coming from the FreeBSD heritage of Mac OS X. And there are still a few working APIs that date back to the pre-Mac OS X days. As a result, there are often multiple ways of accomplishing a given task, such as networking.
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’22
Reply to How to track the key press events of keyboard using SwiftUI for MacOS?
The documentation says Key-related events may only be monitored if accessibility is enabled or if your application is trusted for accessibility access (see AXIsProcessTrusted). See also AXIsProcessTrustedWithOptions and the newer APIs CGPreflightListenEventAccess and CGRequestListenEventAccess. For instance, when you program is starting up, you might call CGPreflightListenEventAccess, and if that returns false, call CGRequestListenEventAccess.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22
Reply to Get Window Number from Keyboard Event Using addGlobalMonitorForEventsMatchingMask and addLocalMonitorForEventsMatchingMask (Objective-C)
I'm not sure why you would assume that a keyboard event has a window number. When you create a keyboard event with CGEventCreateKeyboardEvent, you don't specify a window or a mouse location. And the global event monitor may see events before applications have begun to dispatch them.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to macOS Xcode 14.2 app applicationwillterminate function is not called
macOS apps definitely still have Info.plist files, but you may not be directly editing it. Rather, it may be generated based on settings under the Info tab in your target settings, and values in the Info.plist Values section under Build Settings. I would agree with that other thread that you should look for a plist setting that allows "sudden termination".
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to Any advices for a new kid coming to Apple development?
I can't really answer your specific questions, but I would remark that macOS has multiple layers coming from different eras, somewhat like an archeological dig. Some of the newest APIs can only be used with Apple's new favorite language, Swift. Dig a little deeper and you find lots of APIs designed for use with Objective-C (though they can be used with Swift too.) Below that, there are POSIX APIs coming from the FreeBSD heritage of Mac OS X. And there are still a few working APIs that date back to the pre-Mac OS X days. As a result, there are often multiple ways of accomplishing a given task, such as networking.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to How to track the key press events of keyboard using SwiftUI for MacOS?
The documentation says Key-related events may only be monitored if accessibility is enabled or if your application is trusted for accessibility access (see AXIsProcessTrusted). See also AXIsProcessTrustedWithOptions and the newer APIs CGPreflightListenEventAccess and CGRequestListenEventAccess. For instance, when you program is starting up, you might call CGPreflightListenEventAccess, and if that returns false, call CGRequestListenEventAccess.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22