Thank you for your helpful response.
I am creating a contact app that allows users to manage additional information for their contacts, such as importance levels or complaints. The feature I want to implement is to display this additional information on the incoming call screen.
For example, if a contact is saved as “Mr. Kim Minsu” in the system but “Importance 5 Kim Minsu” in my app, I want the incoming call screen to display “Importance 5 Kim Minsu.”
Post
Replies
Boosts
Views
Activity
This problem seems to be independent of the version of xcode.
This is because it is a problem that occurs even when building with a physical device.
Can you write some simple sample code? I don't understand what to do...
Thank you for answer! Can't i just store specific attributes of an entity as an array?
Uncle! I'm still in development. I'm curious.
When I send data from the watch to the phone, it doesn't show up right away.
I must close the app on the phone and turn it on again to see the transmitted data.
Can't we just transfer the data from the watch and see the data directly on the phone?
I tried to create a sync button in the phone app, but I don't know how to put the code in the button.
Uncle! I'm still in development. I'm curious.
When I send data from the watch to the phone, it doesn't show up right away.
I must close the app on the phone and turn it on again to see the transmitted data.
Can't we just transfer the data from the watch and see the data directly on the phone?
I tried to create a sync button in the phone app, but I don't know how to put the code in the button.
After hearing the explanation, you are right! Then apply your code again and study! Thank you always :)
T.T
Using CoreData to persist data is complicated.
Is there any way to use Userdefaults?
Can't I just create @Published var title = Userdefaults.standard.string(forkey: "title") in the WatchDataModel and let the ContentView store the value there?
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.
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.
I just started development. regardless of developer, I've never seen such a kind person before. you are my first teacher.
I'm using the code you gave me and I'm having a problem. The transferuserInfo method can only exchange one piece of data?
I want to send 'title', 'count1', 'count2', 'creation date' from watch app. but I don't know how to change the code in the PhoneDataModel class..
Can you just explain how to use the userdefault function in the watch app and the coredata and Cloudkit functions in the ios app? I'll make the code.
are you an angel? Thank you so much. I will study harder.
Thank you so much. I'm using xcode 12. And try to develop with swiftui.
Thanks for the reply.
I tried to implement watchconnectivity referring to (https://developer.apple.com/documentation/watchconnectivity/using_watch_connectivity_to_communicate_between_your_apple_watch_app_and_iphone_app) , but it is too difficult.
First of all, I understand using the TransferUserInfo api, but how to implement this concretely is difficult.
May I ask you to edit the file I'm making by sending it to you?