func makeWKInterfaceObject (context: Self.Context) -> Self.WKInterfaceObjectType
func updateWKInterfaceObject (Self.WKInterfaceObjectType , context: Self.Context)
Availability 有効性
Technology
Use a WKInterface
instance to create and manage a WKInterface
in your SwiftUI interface. Adopt this protocol in one of your app’s custom instances, and use its methods to create, update, and tear down your interface object. The creation and update processes parallel the behavior of SwiftUI views, and you use them to configure your interface object with your app’s current state information. Use the teardown process to remove your interface object cleanly from your SwiftUI. For example, you might use the teardown process to notify other parts of your app that the interface object is disappearing.
解体処理を使って、あなたのインターフェイスオブジェクトをあなたのSwiftUIからきれいに取り除いてください。例えば、あなたは解体処理を使って、インターフェイスオブジェクトが見えなくしているあなたのアプリの他の部分に通知します。
To add your interface object into your SwiftUI interface, create your UIView
instance and add it to your SwiftUI interface. The system calls the methods of your representable instance at appropriate times to create and update the interface object.
システムは、あなたの表現可能なインスタンスのメソッドを適時に呼び出して、インターフェイスオブジェクトを作成および更新します。
The system doesn’t automatically communicate changes occurring within your interface object to other parts of your SwiftUI interface. When you want your interface object to coordinate with other SwiftUI views, you must provide a Coordinator
instance to facilitate those interactions. For example, you use a coordinator to forward target-action and delegate messages from your interface object to any SwiftUI views.
例えば、あなたはあるコーディネータを使って、ターゲットアクションと委任先メッセージをあなたのインターフェイスオブジェクトからあらゆるSwiftUIビューへと転送します。
func makeWKInterfaceObject (context: Self.Context) -> Self.WKInterfaceObjectType
func updateWKInterfaceObject (Self.WKInterfaceObjectType , context: Self.Context)
static func dismantleWKInterfaceObject (Self.WKInterfaceObjectType , coordinator: Self.Coordinator)
func makeCoordinator () -> Self.Coordinator
associatedtype Coordinator = Void
associatedtype WKInterfaceObjectType : WKInterfaceObject
struct WKInterfaceObjectRepresentableContext