Skip to content

NAOYA-MAEDA-DEV/Watch-Connectivity-Sample

Repository files navigation

Watch-Connectivity-Sample

Watch-Connectivity-Sample is a sample SwiftUI code for Watch-Connectivity explanation.

https://zenn.dev/naoya_maeda/articles/d63504a860c36c

Text

How to build

  1. Download or Clone this project and open in Xcode.

  2. Build on your actual device or simulator.

Contents

sendMessage(_:replyHandler:errorHandler:)

Sends a message immediately to the paired and active device and optionally handles a response.

Text

updateApplicationContext(_:)

Sends a dictionary of values that a paired and active device can use to synchronize its state.

Text

transferUserInfo(_:)

Sends the specified data dictionary to the counterpart.

Since transferUserInfo(_:) does not work in the simulator, the operation video is omitted.

transferFile(_:metadata:)

Sends the specified file and optional dictionary to the counterpart.

Text

Ver.1.0

Ver. 1.0
Xcode 14.3.1
Swift 5.8.1
iOS 15.0 -
watchOS 8.0 -