Protocol

UIViewRepresentable

A view that represents a UIKit view.

Declaration

protocol UIViewRepresentable where Self.Body == Never

Topics

Associated Types

associatedtype Coordinator

A type to coordinate with the view.

Required.

associatedtype UIViewType

The type of view to present.

Required.

Instance Methods

func makeCoordinator() -> Self.Coordinator

Creates a coordinator instance to coordinate with the UIKit view.

Required. Default implementation provided.

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

Creates a UIKit view to be presented.

Required.

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

Updates the presented UIKit view (and its coordinator) to the latest configuration.

Required.

Type Methods

static func dismantleUIView(Self.UIViewType, coordinator: Self.Coordinator)

Cleans up the presented UIKit view (and coordinator) in anticipation of their removal.

Required. Default implementation provided.

Relationships

Inherits From

See Also

UIKit Hosting

protocol UIViewControllerRepresentable

A view that represents a UIKit view controller.

Beta
struct UIViewRepresentableContext

The context in which updates to an associated UIKit view take place.

Beta
struct UIViewControllerRepresentableContext

The context in which updates to an associated UIKit view controller take place.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software