func makeNSViewController (context: Self.Context) -> Self.NSViewControllerType
func updateNSViewController (Self.NSViewControllerType , context: Self.Context)
associatedtype NSViewControllerType : NSViewController
Availability 有効性
Technology
Use an NSView
instance to create and manage an NSView
object 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 view controller. The creation and update processes parallel the behavior of SwiftUI views, and you use them to configure your view controller with your app’s current state information. Use the teardown process to remove your view controller cleanly from your SwiftUI. For example, you might use the teardown process to notify other objects that the view controller is disappearing.
解体処理を使って、あなたのビューコントローラをあなたのSwiftUIからきれいに取り除いてください。例えば、あなたは解体処理を使って、ビューコントローラが見えなくしている他のオブジェクトに通知します。
To add your view controller into your SwiftUI interface, create your NSView
instance and add it to your SwiftUI interface. The system calls the methods of your custom instance at appropriate times.
システムは、あなたのあつらえのインスタンスを適時に呼び出します。
The system doesn’t automatically communicate changes occurring within your view controller to other parts of your SwiftUI interface. When you want your view controller 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 view controller to any SwiftUI views.
例えば、あなたはあるコーディネータを使って、ターゲットアクションと委任先メッセージをあなたのビューコントローラからあらゆるSwiftUIビューへと転送します。
func makeNSViewController (context: Self.Context) -> Self.NSViewControllerType
func updateNSViewController (Self.NSViewControllerType , context: Self.Context)
associatedtype NSViewControllerType : NSViewController
static func dismantleNSViewController (Self.NSViewControllerType , coordinator: Self.Coordinator)
func makeCoordinator () -> Self.Coordinator
associatedtype Coordinator = Void
protocol NSViewRepresentable
struct NSViewRepresentableContext
struct NSViewControllerRepresentableContext