Instance Method

updateUIView(_:context:)

Updates the state of the specified view with new information from SwiftUI.

Required.

Declaration

func updateUIView(_ uiView: Self.UIViewType, context: Self.Context)

Parameters

nsView

Your custom view object.

context

A context structure containing information about the current state of the system.

Discussion

When the state of your app changes, SwiftUI updates the portions of your interface affected by those changes. SwiftUI calls this method for any changes affecting the corresponding UIKit view. Use this method to update the configuration of your view to match the new state information provided in the context parameter.

See Also

Creating and Updating the View

func makeUIView(context: Self.Context) -> Self.UIViewType

Creates the view object and configures its initial state.

Required.

struct UIViewRepresentableContext

Contextual information about the state of the system that you use to create and update your UIKit view.

associatedtype UIViewType

The type of view to present.

Required.