pageController(_:viewControllerForIdentifier:)
Returns a view controller the page controller uses for managing the specified identifier.
Declaration
@MainActor optional func pageController(_ pageController: NSPageController, viewControllerForIdentifier identifier: NSPageController.ObjectIdentifier) -> NSViewControllerParameters
- pageController:
The page controller.
- identifier:
The identifier for a view controller.
Return Value
Returns the view controller for the specified identifier.
Discussion
Your implementation of this method should return the requested view controller for the identifier or create and return a new view controller.
NSPageController will cache as many view controllers and views as necessary to maintain performance. This method is called whenever another instance is required.
The view controller may become the selectedViewController after a transition if necessary.