NSPageControllerDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.8 and later.
Declared in
NSPageController.h
Related sample code

Overview

The NSPageControllerDelegate protocol allows you to customize the behavior of instances of the NSPageController class.

See NSPageController Class Reference for more information.

Tasks

Transition Notification

Managing View Controllers

Instance Methods

pageController:didTransitionToObject:

This message is sent when any page transition is completed.

- (void)pageController:(NSPageController *)pageController didTransitionToObject:(id)object
Parameters
pageController

The page controller.

object

The object to display.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSPageController.h

pageController:frameForObject:

Returns the frame appropriate for displaying the specified object.

- (NSRect)pageController:(NSPageController *)pageController frameForObject:(id)object
Parameters
pageController

The page controller.

object

The object to display.

Return Value

The frame appropriate for displaying object.

Discussion

You only need to implement this if the view frame can differ between the page controller’s arrangedObjects.

This method must return immediately. Avoid file, network or any potentially blocking or lengthy work to provide an answer.

If this method is not implemented, all arrangedObjects are assumed to have the same frame as the pageController object’s current selectedViewController instance’s view or the bounds of view when selectedViewController is nil.

This method is only useful if pageController:identifierForObject: and pageController:viewControllerForIdentifier: are implemented.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSPageController.h

pageController:identifierForObject:

Return the identifier of the view controller that owns a view to display the object.

- (NSString *)pageController:(NSPageController *)pageController identifierForObject:(id)object
Parameters
pageController

The page controller.

object

The object to display.

Return Value

Returns a string identifier for the view controller for the specified object.

Discussion

If pageController does not have an unused view controller for this identifier, the you will be asked to create one via pageController:viewControllerForIdentifier:.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSPageController.h

pageController:prepareViewController:withObject:

Prepare the view controller and it’s view for drawing.

- (void)pageController:(NSPageController *)pageController prepareViewController:(NSViewController *)viewController withObject:(id)object
Parameters
pageController

The page controller.

viewController

The view controller to prepare for drawing. You should setup the data sources and perform layout.

object

The object to display.

Discussion

If this method is not implemented, then viewController object’s representedObject is set to the object.

This method is only useful if pageController:identifierForObject: and pageController:prepareViewController:withObject: are implemented.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSPageController.h

pageController:viewControllerForIdentifier:

Returns a view controller the page controller uses for managing the specified identifier.

- (NSViewController *)pageController:(NSPageController *)pageController viewControllerForIdentifier:(NSString *)identifier
Parameters
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.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSPageController.h

pageControllerDidEndLiveTransition:

This message is sent when a transition animation completes.

- (void)pageControllerDidEndLiveTransition:(NSPageController *)pageController
Parameters
pageController

The page controller.

Discussion

This message is sent when a transition animation completes either via swipe gesture or one of the page controller’s target-action navigation methods.

Your content view is still hidden and you must call the completeTransition method on pageController when your content is ready to show.

If completed successfully, a pageController:didTransitionToObject: will already have been sent.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSPageController.h

pageControllerWillStartLiveTransition:

This message is sent when the user begins a transition.

- (void)pageControllerWillStartLiveTransition:(NSPageController *)pageController
Parameters
pageController

The page controller.

Discussion

This message is sent when the user begins a transition whether via a swipe gesture of one of the page controller’s target-action navigation methods.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSPageController.h