Post

Replies

Boosts

Views

Activity

WidgetKit - macOS don't run IntentHandler
Hi I have same code for IntentHandler for iOS and macOS. On iOS works perfectly on macOS not at all. In WidgetKit simulator I even see option to configure the widget so it load the .intentdefinition file. I also checked that IntentHandler and all required files (CoreData model etc) are in the target for both macOS, widget and Intent. When try to edit the Widget I get - No options were provided for this parameter. Also I tried to remove all same App from macOs, cleaned Derived data. Thanks My implementation of Intent import Intents enum IntentErrors: Error {     case allIsWrong } final class IntentHandler: INExtension {     override func handler(for intent: INIntent) -> Any {         // This is the default implementation.  If you want different objects to handle different intents,         // you can override this and return the handler you want for that particular intent.         return self     } } extension IntentHandler: RecentWeddingIntentHandling {     func provideWeddingOptionsCollection(         for intent: RecentWeddingIntent,         with completion: @escaping (INObjectCollection<IntentWedding>?, Error?         ) -> Swift.Void)     {         guard let weddingsInstances = CDWedding.instances else {             let weddings = [IntentWedding(identifier: "createId", display: "Please create wedding")]             let collection = INObjectCollection(items: weddings)             completion(collection, IntentErrors.allIsWrong)             return         }         let weddings = weddingsInstances.map { wedding in             IntentWedding(identifier: wedding.id, display: wedding.name)         }         let collection = INObjectCollection(items: weddings)         completion(collection, nil)     }     func defaultWedding(for intent: RecentWeddingIntent) -> IntentWedding? {         if let wedding = UserSettings.shared.correctUser?.selectedWedding {             return IntentWedding(identifier: wedding.id, display: wedding.name)         } else {             let wedding = IntentWedding(identifier: "createId", display: "Please create wedding")             return wedding         }     } }
2
0
1.1k
Feb ’21
SwiftUI macOS SignInWithAppleButton in
In SwiftUI I got error when I use SignInWithAppleButton in SplitReplacementHostingController I got crash Fatal error: Attempting to present ASAuthorizationController from a SwiftUI view not in a heirarchy. This should not be possible, please file feedback.: file _AuthenticationServices_SwiftUI/SignInWithAppleButton.swift, line 300 Fatal error: Attempting to present ASAuthorizationController from a SwiftUI view not in a heirarchy. This should not be possible, please file feedback.: file _AuthenticationServices_SwiftUI/SignInWithAppleButton.swift, line 300 When I place the same button to first screen in the app it works Mainly it is because I have Sidebar and NavigationView which is preferred for the macOS so when I have the two column placeholder there as the button it works but when I navigate via NavigationLink it stop working I used Xcode 12.2 beta 3 (12B5035g) Big Sur 20A5395g
9
0
2.4k
Oct ’20
CoreData in Multiplatform App
Hi I have an issue with Multiplatform app which use CoreData Hosted in CloudKit Xcode 12 Beta 5 (12A8189h) I don't change anything in the code and try to run it. Build succeed Run the app on macOs and get immediately this crash CoreData: error:  Failed to load model named Testing 2020-08-22 09:08:36.421964+0200 Testing[27537:463165] [error] error: No NSEntityDescriptions in any model claim the NSManagedObject subclass 'Item' so +entity is confused.  Have you loaded your NSManagedObjectModel yet ? CoreData: error: No NSEntityDescriptions in any model claim the NSManagedObject subclass 'Item' so +entity is confused.  Have you loaded your NSManagedObjectModel yet ? 2020-08-22 09:08:36.422022+0200 Testing[27537:463165] [error] error: +[Item entity] Failed to find a unique match for an NSEntityDescription to a managed object subclass CoreData: error: +[Item entity] Failed to find a unique match for an NSEntityDescription to a managed object subclass Fatal error: UnsafeRawBufferPointer with negative count: file Swift/UnsafeRawBufferPointer.swift, line 872 2020-08-22 09:08:36.553889+0200 Testing[27537:463165] Fatal error: UnsafeRawBufferPointer with negative count: file Swift/UnsafeRawBufferPointer.swift, line 872 Run it on iOS iPhone 11 Pro and get imidiatly crash CoreData: error:  Failed to load model named Testing 2020-08-22 09:09:55.317706+0200 Testing[27619:466516] libMobileGestalt MobileGestaltCache.c:38: No persisted cache on this platform. 2020-08-22 09:09:55.334598+0200 Testing[27619:465943] [error] error: No NSEntityDescriptions in any model claim the NSManagedObject subclass 'Item' so +entity is confused.  Have you loaded your NSManagedObjectModel yet ? CoreData: error: No NSEntityDescriptions in any model claim the NSManagedObject subclass 'Item' so +entity is confused.  Have you loaded your NSManagedObjectModel yet ? 2020-08-22 09:09:55.334797+0200 Testing[27619:465943] [error] error: +[Item entity] Failed to find a unique match for an NSEntityDescription to a managed object subclass CoreData: error: +[Item entity] Failed to find a unique match for an NSEntityDescription to a managed object subclass Fatal error: UnsafeRawBufferPointer with negative count: file Swift/UnsafeRawBufferPointer.swift, line 872 2020-08-22 09:09:55.370937+0200 Testing[27619:465943] Fatal error: UnsafeRawBufferPointer with negative count: file Swift/UnsafeRawBufferPointer.swift, line 872 In Xcdatamodelid there is nothing to pick from Class -> Module (in previous versions was Current Module as an option there) &check; Tried to clean derived data &check; Tried to clean project &check; Tried to change Item Class module from Global namespace to hardly written Current Module &check; Tried to change Codegen from ClassDefinition to Manual / None and create property my self
2
0
3.9k
Aug ’20