This is a sample app of the function(Watch Connectivity)
to transfer data from Watch App to iPhone App in the background.
This sample is used SwiftUI.
The following repository is a similar sample.
This is a sample app that both apps use while active.
https://github.com/MilanistaDev/WatchConnectivitySampleForSwiftUI
https://qiita.com/MilanistaDev/items/0ce079b255034be84472
- Xcode 13 and later
- iOS 15 and later
- watchOS 8.0 and later
- ↑Need pairing
- SwiftUI 3
Always test Watch Connectivity data transfers on paired devices. The Simulator app doesn’t support the transferUserInfo(_:) method.
Only actual device.
iOS 14 and watchOS 7 is supported, too.
(Please modify NavigationView
code.)
wc_sample_fixed.mov
Please feel free to contact us if you find a bug or have any feedback.
Suggestions for adding functions and code corrections are also welcome.
let name = "Takuya Aso"
let email = "milanista224" + "@" + "icloud.com"
let profession = "iOS Engineer"
let location = "Tokyo"