I’m presently creating an app for iOS 17/watchOS 10 which is principally a exercise app that synchronizes knowledge with the brand new Swift API for exercise mirroring (func startMirroringToCompanionDevice(completion: @escaping (Bool, Error?) -> Void)
).
Nonetheless, I attempted a number of approaches to save lots of knowledge the consumer inputs himself through the exercise after establishing the CloudKit container:
- I marked all my courses as
@Mannequin
, however this might create duplicate entries within the CloudKit container when sending the info from iPhone to Apple Watch and vice versa. - I made comparable courses with out the usage of
@Mannequin
for the presently operating exercise from the SwiftData fashions, however this appears not like a superb method due to duplicated code for my part. - I attempted to save lots of my customized knowledge with the
HKWorkout
itself however so far as I do know there is no such thing as a method of saving any customized metadata?
I might respect any enter on this subject as that is my first challenge with Swift improvement. I might additionally wish to run the app as iPhone solely/Apple Watch solely app, however syncing the info between the gadgets and saving it appropriatelly is my predominant focus for the time being.