I just started development. regardless of developer, I've never seen such a kind person before. you are my first teacher.
Post
Replies
Boosts
Views
Activity
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.
To Michaela
Couldn't explain my app in detail.
summary:
(in watch app)
Set the name of the item to be counted and count two.
That is, there are count 1 and count 2.
This app should keep the item's name and count number even when multitasking is finished.
And when the 'send to phone' button is pressed, the data set is sent to the phone and the variables are initialized.
(in phone app)
Store the data received from the watch in CoreData. In the contentview area, we will output the data stored in CoreData as a table.
Simple... that's all.
Questions:
Why not use userdefaults inside WatchDataModel?
Is there a method that receives data from PhoneDataModel to WCSession and saves it in CoreData at the same time? (Entity:Goal/Attributes:title, criationdate, Shooting, save)
I will never forget thank you.
func of package
Thank you for your kind response.
Let me explain what I’m trying to implement in detail.
I am creating a contact app that provides users with the ability to manage additional information (such as importance levels or complaints) for their contacts. The feature I want to implement is to display this additional information on the incoming call screen when receiving a call from someone saved in the contacts.
For example, if the system contact is saved as “Mr. Kim Minsu” but in this app, it’s saved as “Importance 5 Kim Minsu,” I want the incoming call screen to display “Importance 5 Kim Minsu” when the call is received.
According to the documentation in https://developer.apple.com/documentation/callkit/identifying-and-blocking-calls, it seems that the Call Directory is only referenced for phone numbers that are not in the system contacts. Is that correct?
I am wondering if it’s possible for my app to reference contacts in the system contacts as well.