Post

Replies

Boosts

Views

Activity

Reply to Invalid Bundle ID for container
I had this problem as well and I believe what I did wrong was when I created the iCloud container ID I manually typed in the "iCloud" at the start of the bundle ID. For example I created the iCloud container ID as "iCloud.com.myBundleName.myCompany". Xcode automatically adds the "iCloud" to the beginning of the name you type, so I believe what it was seeing was "iCloud.iCloud.com.myBundleName.myCompany" and thus giving the error. Try just typing "com.whateverBundleName.whateverCompany" and Xcode will add the iCloud at the beginning automatically. That solved the error for me.
Dec ’22
Reply to WKExtension and ExtensionDelegate
Make sure your ExtensionDelegate conforms to ObservableObject. For example; class ExtensionDelegate: NSObject, ObservableObject, WKExtensionDelegate {		 var meetingStatistics:	MeetingStatistics = MeetingStatistics() } It's mentioned rather quietly in the second init() that the class needs to conform to ObservableObject. https://developer.apple.com/documentation/swiftui/wkextensiondelegateadaptor
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’20
Reply to Background tasks no longer working since update to watchOS7
If your deployment target is set to watchOS7 for the minimum version your app may not be looking for your ExtensionDelegate any longer. You can use the property wrapper @WKExtensionDelegateAdaptor to observe your ExtensionDelegate. Make sure your ExtensionDelegate conforms to ObservableObject. Something to this effect should work. @main struct RunPlanner: App { @Environment(\.scenePhase) var scenePhase @WKExtensionDelegateAdaptor(ExtensionDelegate.self) var delegate var body: some Scene { WindowGroup { ContentView() } .onChange(of: scenePhase) { phase in switch phase { case .active: print("\(#function) REPORTS - App change of scenePhase to ACTIVE") case .inactive: print("\(#function) REPORTS - App change of scenePhase Inactive") case .background: startBackgroundRefresh() default: print("\(#function) REPORTS - App change of scenePhase Default") } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’20
Reply to Is the SwiftUI CoreData-CloudKit iOS template supposed to do anything?
It's an issue with this block of code:         .toolbar {             #if os(iOS)             EditButton()             #endif             Button(action: addItem) {                 Label("Add Item", systemImage: "plus")             }         } if you replace the View with this you should see a "+ Add Item" button in the menu which will add items to CoreData. var body: some View { NavigationView { List { ForEach(items) { item in Text("Item at \(item.timestamp!, formatter: itemFormatter)") } .onDelete(perform: deleteItems) } .navigationBarItems(trailing: Button(action: addItem) { Label("Add Item", systemImage: "plus") }) }     } I field Feedback on issues with .toolBar back in July and it hasn't been resolved yet. FB8101065
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’20
Reply to Sample project not working?
I believe the problem is a bug in the .toolbar where items will not show up. If you replace Apple's default code and use .navigationBarItems (instead of .toolbar) you'll be able to see the buttons so you can add items to the CoreData list. Replace the default View body code with this and it should work for you. var body: some View { NavigationView { List { ForEach(items) { item in Text("Item at \(item.timestamp!, formatter: itemFormatter)") } .onDelete(perform: deleteItems) } .navigationBarItems(leading: EditButton(), trailing: Button(action: addItem, label: { Label("Add Item", systemImage: "plus") }) ) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’20