Post

Replies

Boosts

Views

Activity

Reply to UIKit Live Preview for Objective-C View Controller?
Thanks for that tip. It doesn't appear to be possible to create a live preview purely from Objective-C unfortunately. When I expand the macro I see it uses API declared in the DeveloperToolsSupport.framework which is Swift only and everything is Swift structs and Swift protocols not exposed to Objective-C. You can create a live preview for an Objective-C view controller/view in a Swift source file...by importing the Objective-C header and then create the Objective-C view controller from a Swift source file in the Preview macro: //In a Swift source file (make sure header file is imported for the view controller/view in the bridging header) #Preview { let someVC = ObjCViewController() return someVC } This seems kind of silly and dev hostile IMO. The preview works but you have to jump back and forth between the Objective-C .m and the Swift file created only for the purpose of making the live preview.
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’23
Reply to Customize NSToolbar context menu on Sonoma
Is the allowsUserCustomization property set to YES on the toolbar? self.myNSToolbar.allowsUserCustomization = YES; self.myNSToolbar.autosavesConfiguration = YES; //<--Most likely want this to YES too. If you are using Interface Builder make sure the checkboxes corresponding to these properties are checked.
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’23
Reply to Should I Remove Mac Catalyst Destination and Add Mac (Designed for iPad) Destination? - Opinions Welcomed
The idea is that the developer is expected to provide a better user experience if you use Mac Catalyst and put in the time and effort to make your app feel like a "Mac App" (by that I mean an app that behaves as close to an AppKit app as possible, though Mac Catalyst creates some arbitrary barriers that does not always make this an easy task). If you let your iPad app run on Mac unmodified it's definitely easier for you. It all depends whether or not you think your app is "good enough" for Mac as an unmodified iPad app. It won't run on Intel Macs though.
Topic: App & System Services SubTopic: Hardware Tags:
Sep ’23
Reply to UIKit Live Preview for Objective-C View Controller?
@previewseng Nice tip. That does work and will have to do for now when I want to use a Live Preview. I get great compiler performance and it never crashes for ObjC so it's kind of a shame I have to pollute my code base with Swift for a design time feature (** JOKING**. I'm only JOKING don't kill me Swifters).
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’23
Reply to Mac Catalyst Modally Presented View Controllers Not Working in Xcode Live Previews
If I hit the "Play" button in the Preview my app icon appears in the dock and it says "Previewing on 'Local Mac'" and there is a button that says "Bring Forward" but I see nothing. If I click the "Bring Forward" button it launches the preview (my app?) and it shows me the view controller I'm previewing and it does perform the modal presentation in the window brought forward. .....but if I make a change to the source code this window doesn't refresh it stops the preview and I have to relaunch it. I don't see how this is any different from launching my app normally as the preview is not live. Are Mac "Live Previews" supposed to behave this way or is this a bug?
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’23
Reply to AVSpeechSynthesizer is broken on iOS 17 in Xcode 15
@dw_dw My TSI got credited back to my account and they said there is "no workaround" and the issue is being investigated. I was wondering the same thing about 17.1 beta but haven't checked it out myself. Sidenode for whatever reason e-mail notifications aren't working for me on this thread even though I'm watching it. Have to check back manually periodically to see if anyone is posting here.
Topic: Media Technologies SubTopic: Audio Tags:
Oct ’23
Reply to Find all Finder tags
This limitation never made any sense especially given the fact that NSURL has NSURLTagNamesKey which may be set and get. Way back in the day I was looking to do this. I naturally thought NSWorkspace API related to "file labels" (which I think tags replaced) would maybe just map to tag names but it didn't work. NSWorkspaceDidChangeFileLabelsNotification never got posted so I gave up.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’23