Posts

Post marked as solved
1 Replies
0 Views
The app delegate callback is only used with NSDocument-based file-opening method, which requires configuring appropriate file types supported by the app in app's "Info.plist". We can instead rely on NSOpenPanel for a customized file openning experience - write an @IBAction callback to be invoked when the open command is issued (from keyboard shortcut or app menu), and instantiate an NSOpenPanel to open the file.
Post not yet marked as solved
1 Replies
0 Views
Prepare all the graphical assets in the DisplayLink thread, and asynchronously mark the view as need updating with: DispatchQueue.main.async { view.needsDisplay = true } Then do as little as possible and as much as necessary in draw to draw the contents. Remarks The context to which drawing commands are issued to is not static - it's instantiated on-demand. NSView have the requirement that many of its interfaces be invoked only on the main thread.