Loads the view controller’s view if it has not yet been loaded.
SDKs
- iOS 9.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
func loadViewIfNeeded()
Discussion
Calling this method loads the view controller’s view from its storyboard file, or creates the view as needed based on the established rules.