Posts

Post not yet marked as solved
2 Replies
My previous code was not functional (edited in this forum without compiling), but the problem is the same (the correct configuration provided below was used during my tests). class LocationDataManager: NSObject, CLLocationManagerDelegate { private let locationManager: CLLocationManager = CLLocationManager() var activityType: CLActivityType = .automotiveNavigation { didSet { locationManager.activityType = activityType } } var desiredAccuracy: CLLocationAccuracy = kCLLocationAccuracyBestForNavigation { didSet { locationManager.desiredAccuracy = desiredAccuracy } } var pausesLocationUpdatesAutomatically: Bool = false { didSet { locationManager.pausesLocationUpdatesAutomatically = pausesLocationUpdatesAutomatically } } var distanceFilter: CLLocationDistance = kCLDistanceFilterNone { didSet { locationManager.distanceFilter = distanceFilter } } override init() { super.init() locationManager.delegate = self locationManager.activityType = .automotiveNavigation // controlled by the Picker locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation // controlled by the Picker locationManager.pausesLocationUpdatesAutomatically = false // controlled by the Toggle locationManager.distanceFilter = kCLDistanceFilterNone // controlled by the Picker locationManager.allowsBackgroundLocationUpdates = true } func start() { locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() } func stop() { locationManager.stopUpdatingLocation() } func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { print(error) } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { print(locations.last) } func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) { print(#function) } func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) { print(#function) } }
Post not yet marked as solved
2 Replies
I include some basic code to better illustrate how the CLLocationManager is configured and used. class LocationDataManager: NSObject, CLLocationManagerDelegate { private let locationManager: CLLocationManager var activityType: CLActivityType = .automotiveNavigation { didSet { locationManager.activityType = activityType } } var desiredAccuracy: CLLocationAccuracy = kCLLocationAccuracyBestForNavigation { didSet { locationManager.desiredAccuracy = desiredAccuracy } } var pausesLocationUpdatesAutomatically: Bool = false { didSet { locationManager.pausesLocationUpdatesAutomatically = pausesLocationUpdatesAutomatically } } var distanceFilter: CLLocationDistance = kCLDistanceFilterNone { didSet { locationManager.distanceFilter = distanceFilter } } init() { locationManager = CLLocationManager() locationManager.activityType = .automotiveNavigation // controlled by the Picker locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation // controlled by the Picker locationManager.pausesLocationUpdatesAutomatically = false // controlled by the Toggle locationManager.distanceFilter = kCLDistanceFilterNone // controlled by the Picker locationManager.allowsBackgroundLocationUpdates = true } func start() { locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() } func stop() { locationManager.stopUpdatingLocation() } func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { print(error) } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { print(locations.last) } func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) { print(#function) } func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) { print(#function) } }
Post not yet marked as solved
23 Replies
In a project using Core Data where I pass multiple objects to the navigationDestination (see example below), I'm seeing a lot of "Update NavigationAuthority possible destinations tried to update multiple times per frame." when I navigate in the Stack. After few push and pop in the stack, the app freezes, the memory increases, the CPU runs at 100%, then the app crashes. I checked the logs from my device: the issues are different every time, but it seems to be linked to a UI update. .navigationDestination(for: Paragraph.self) { paragraph in ParagraphDetail( post: post,         paragraph: paragraph) // -> Update NavigationAuthority possible destinations tried to update multiple times per frame. } In a NavigationStack where I only pass one object in the navigationDestination (see below), I don't have this log message, and the app never freezes. .navigationDestination(for: Paragraph.self) { paragraph in ParagraphDetailOnlyParagraph(paragraph: paragraph) } To identify if it's related to Core Data or not, I reproduced the same NavigationStack with plain Structs, or simple Class objects. I don't see the log message, even when I pass multiple objects to the navigationDestination. The app never freezes. I'll file a FB. It seems to be a bug in beta 1.
Post not yet marked as solved
4 Replies
Thanks for your answer. I’m observing the same behaviour in the sandbox environment. Here are the steps I've done if that helps: I created a Sandbox account in App Store Connect: I cleared the Purchase History for this tester and set the Subscription Renewal Rate to Monthly Renewal Every 3 Minutes. I created a fake App in App Store Connect. I configured a subscription group in App Store Connect for this fake app and added a monthly subscription to this subscription group (this monthly subscription is in Ready To Submit stage after I added enough meta data). I run the app without using the Xcode config file: the product added to the app on App Store Connect is correctly loaded by the app and I can subscribe to it using the sandbox account on a real device. I leave the app opened and I receive the transactions when the app is running. I hard quit the app and wait enough time for virtual renewals to normally be created (for example I wait 30 minutes, which should have renewed the app 10 times based on the Sandbox tester account setup for subscription renewal rate). I launch the app again and fetch the last transaction for this subscription: it's still the one downloaded 30 minutes ago, before the app was quitted. I fear the behavior is the same in a production environment so I fear I missed anything and don’t want to ship not working subscription management in my app.
Post not yet marked as solved
2 Replies
Thanks, I think a bug in Xcode made it hard for me to understand that a transaction for a free trial is a transaction with the trial duration (I thought it was included in a normal transaction). When running in Simulator, the introductory offer is not taken into account and the first transaction has a duration equals to the subscription period (see attached screenshots). It's working correctly on a real device. If you want to try it by yourself, I submitted a feedback FB9789041 few minutes ago: StoreKit 2 • introductory offer duration ignored in Simulator, where the expirationDate is wrong (correct on real device).
Post not yet marked as solved
2 Replies
It's working normally with Xcode Version 13.1 (13A1030d) and iOS 15.0 (simulator). I think it's a bug, I'll fill a report for that.
Post marked as solved
52 Replies
I just tested on macOS Big Sur 11.5 Beta 1 (20G5023d). Still the same on my side... For information, my Mac is a MacBook Pro (Retina, 13-inch, Late 2013) // 2,6 GHz Dual-Core Intel Core i5 // 16 GB 1600 MHz DDR3 // Intel Iris 1536 MB.
Post not yet marked as solved
6 Replies
Have you been able to find a way to have both only master and master with detail? I’m having the same issue. Tried different layouts but without luck.
Post not yet marked as solved
1 Replies
You have to use Configurations to do that, with two stores (one local, and one for the cloud). Then you choose what entities you want to have in each store. Have a look at the Apple documentation here: https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/setting_up_core_data_with_cloudkit#3193724
Post not yet marked as solved
21 Replies
On my side, I don't have this issue anymore with Xcode 14.5 Beta 3.
Post not yet marked as solved
3 Replies
Hey @wingover, could you please share the tutorials you’re talking about please? I’m looking for some best practices regarding how to manage Core Data in the MVVM pattern, notably if objects should be wrapped in struct when used in the app.
Post not yet marked as solved
1 Replies
From my understanding, it's only possible to use the @sum function for one to many relationships, and not many to many. In my project, the derived attribute is using a many to many relationship (one user can have many expenses, and an expense can have many users). I opened a feedback FB8889366 // https://feedbackassistant.apple.com/feedback/8889366
Post marked as solved
5 Replies
So if I add a free developer account to my team, I cannot share my CloudKit dashboard access? I want to create a test account for my app, and test if the sync is working as expected. I can't use my main ADP account, and wanted to use another account associated to a different email address I own. I invited this second address in my team on App Store Connect, but I don't see this address when I try to share a Container (Container Permissions on CloudKit dashboard).
Post marked as solved
3 Replies
I'm seeing the same behavior on my side. Seems to be a bug. Any better workaround?