To. Michaela
I'm looking at your code and studying it carefully. But I think your teaching will be meaningful only if I can make it myself.
I'm really sorry, but can you explain the process of WatchConnectivity?
No site explains the process in an easy to understand way.
But your code is interesting because it consists only of 'WatchDataModel', 'PhoneDataModel'.
It would be easier to understand if you explain how the 'TransferUserInfo' method works in your code.
Specific questions are as follows:
I think you should use the userdefaults method to keep the count data even when multitasking of the watch app is turned off. So, can we record title, count1, and count2 as UserDefaults in the ContentView file of the watch app and send them to the Phone app using the transferuserinfo method?
Is the 'WatchDataModel' class a class that implements a data transmission method?
Is data.session.transferUserInfo(["WatchCount":data.watchCount]) in the button area of the watch app's ContentView the same as WCSession.default.transferUserInfo(["WatchCount":data.watchCount])?
If so, does func session(_ session: WCSession, didReceiveUserInfo userInfo: [String: Any]) in PhoneDataModel class receive data.watchCount (= watchCount variable in WatchDataModel class) with key "WatchCount"?
If this is a function that receives data, can I write a code that directly saves the received data as CoreData?
If so, wouldn't it be enough to simply output the number of CoreData in the Phone app's ContentView?
It may be cumbersome, but in Korea where I live, there is no one who can answer these questions. There are very few people majoring in programming in Korea, and there is no space to share knowledge. So I'm studying by myself with a translator. Your answer is taking me step by step. Thank you so much.