Post

Replies

Boosts

Views

Activity

Cocoa NSStatusItem has no button property
Hey, I'm creating an NSStatusItem but I can't access the button, it crashes if I unwrap it. import Cocoa func main() {     let delegate = AppDelegate()     let app = NSApplication.shared     app.delegate = delegate     app.setActivationPolicy(.prohibited)     app.run() } final class AppDelegate: NSObject, NSApplicationDelegate {         var item: NSStatusItem!     func applicationDidFinishLaunching(_ aNotification: Notification) {         item = NSStatusItem()         item.behavior = [.removalAllowed, .terminationOnRemoval]         item.button!.image = NSImage(named: "circle.fill") // Crashes here     } }
1
1
346
Jan ’23
RenameButton()
Hi! I tried the new rename button, but I don't see how is this supposed to work in a document app; I can't find a way to access the file to get the binding. There is next to no documentation on anything, I don't understand why SwiftUI gets almost zero attention from Apple. Also, the toolbar has a double back button for some reason. Even with just the template.
1
1
1.4k
Sep ’22