Initializer

init(coder:)

Creates a hosting controller object from the contents of the specified archive.

Declaration

@objc required dynamic init?(coder aDecoder: NSCoder)

Parameters

coder

The decoder to use during initialization.

Discussion

The default implementation of this method throws an exception. To create your view controller from an archive, override this method and initialize the superclass using the init(coder:rootView:) method instead.

See Also

Creating a Hosting Controller Object

init(rootView: Content)

Creates a hosting controller object that wraps the specified SwiftUI view.

init?(coder: NSCoder, rootView: Content)

Creates a hosting controller object from an archive and the specified SwiftUI view.

init(nibName: String?, bundle: Bundle?)

Creates a hosting controller object from the contents of the specified nib file.