Junior — Middle
At what stage of the lifecycle is the XIB interface file loaded in an iOS application?
sobes.tech AI
Answer from AI
Loading a XIB file in an iOS application occurs during the initialization phase of the controller, usually in the init(nibName:bundle:) methods or when calling loadView(). When creating an instance of UIViewController with a specified XIB file, the system automatically loads the interface from the XIB during the controller's initialization process, before calling viewDidLoad. Thus, the XIB is loaded before the controller is fully ready for display, ensuring access to UI elements in viewDidLoad.