Post

Replies

Boosts

Views

Activity

Comment on Unable to distribute watchOS only build
Hi, sorry you having this issue, it's really confusing. If you create new watchOS only project WITHOUT companion iOS apps, you will see it has extra iOS target. This is necessary to distribute the app. It still has only watchOS app. Make sure that watchOS app is really what you need, because you can't add the companion iOS app later, you will have to create a new project. Screenshot https://www.cocoaswitch.com/uploads/2025/screenshot-2025-02-01-at-11.53.57am.png
Topic: App & System Services SubTopic: General Tags:
Feb ’25
Comment on Enabling undo with multi-model schema
Unlike the Hacking with Swift article, I set my undo manager from the environment and it works. The only catch you can't do in the app context, it has to be on a view level. In any content view, we can access undo manager through the @Environment(\.undoManager) var undoManager, then when I create my content view I initiate the background task using the .task modifier, and setting the under manager: modelContext.undoManager = undoManager. It's probably not a best practice though.
Dec ’23
Comment on Unable to distribute watchOS only build
Hi, sorry you having this issue, it's really confusing. If you create new watchOS only project WITHOUT companion iOS apps, you will see it has extra iOS target. This is necessary to distribute the app. It still has only watchOS app. Make sure that watchOS app is really what you need, because you can't add the companion iOS app later, you will have to create a new project. Screenshot https://www.cocoaswitch.com/uploads/2025/screenshot-2025-02-01-at-11.53.57am.png
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Comment on Enabling undo with multi-model schema
Unlike the Hacking with Swift article, I set my undo manager from the environment and it works. The only catch you can't do in the app context, it has to be on a view level. In any content view, we can access undo manager through the @Environment(\.undoManager) var undoManager, then when I create my content view I initiate the background task using the .task modifier, and setting the under manager: modelContext.undoManager = undoManager. It's probably not a best practice though.
Replies
Boosts
Views
Activity
Dec ’23
Comment on Enabling undo with multi-model schema
A hackingwithswift article suggests creating a new UndoManager for the shared container. However, this technique doesn't work for me and Undo/Redo commands are greyed out in my test app. container = try ModelContainer(for: Store.self, Book.self) container.mainContext.undoManager = UndoManager()
Replies
Boosts
Views
Activity
Dec ’23
Comment on Unable to distribute watchOS only build
Thanks. I have replied with the information. Also filed feedback with sample project. FB13204465
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on watchOS 10, widgets, widget doesn't appear in the gallery
Clarification, 1 and 2 are .watchkitapp and .watchkitapp.widget. Minor annoyance, I still don't see the widget on the Simulator but it shows in the Smart Stack on my Apple Watch.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’23