Class: UIPageViewController

Inherits:
UIViewController show all

Overview

Page view controllers allow users to navigate between view controllers using the specified transition. Navigation can be controlled by the user using gestures as well as programatically.

Instance Attribute Summary (collapse)

Attributes inherited from UIViewController

#childViewControllers, #contentSizeForViewInPopover, #definesPresentationContext, #editing, #hidesBottomBarWhenPushed, #interfaceOrientation, #modalInPopover, #modalPresentationStyle, #modalTransitionStyle, #navigationController, #navigationItem, #nibBundle, #nibName, #parentViewController, #presentedViewController, #presentingViewController, #providesPresentationContextTransitionStyle, #restorationClass, #restorationIdentifier, #searchDisplayController, #splitViewController, #storyboard, #tabBarController, #tabBarItem, #title, #toolbarItems, #view, #wantsFullScreenLayout

Attributes inherited from UIResponder

#inputAccessoryView, #inputView, #undoManager

Instance Method Summary (collapse)

Methods inherited from UIViewController

#addChildViewController:, attemptRotationToDeviceOrientation, #beginAppearanceTransition:animated:, #canPerformUnwindSegueAction:fromViewController:withSender:, #decodeRestorableStateWithCoder:, #didMoveToParentViewController:, #didReceiveMemoryWarning, #didRotateFromInterfaceOrientation:, #disablesAutomaticKeyboardDismissal, #dismissViewControllerAnimated:completion:, #editButtonItem, #encodeRestorableStateWithCoder:, #endAppearanceTransition, #initWithNibName:bundle:, #isBeingDismissed, #isBeingPresented, #isMovingFromParentViewController, #isMovingToParentViewController, #isViewLoaded, #loadView, #performSegueWithIdentifier:sender:, #preferredInterfaceOrientationForPresentation, #prepareForSegue:sender:, #presentViewController:animated:completion:, #removeFromParentViewController, #rotatingFooterView, #rotatingHeaderView, #segueForUnwindingToViewController:fromViewController:identifier:, #setEditing:animated:, #setToolbarItems:animated:, #shouldAutomaticallyForwardAppearanceMethods, #shouldAutomaticallyForwardRotationMethods, #shouldAutorotate, #shouldPerformSegueWithIdentifier:sender:, #supportedInterfaceOrientations, #transitionFromViewController:toViewController:duration:options:animations:completion:, #updateViewConstraints, #viewControllerForUnwindSegueAction:fromViewController:withSender:, #viewDidAppear:, #viewDidDisappear:, #viewDidLayoutSubviews, #viewDidLoad, #viewWillAppear:, #viewWillDisappear:, #viewWillLayoutSubviews, #willAnimateRotationToInterfaceOrientation:duration:, #willMoveToParentViewController:, #willRotateToInterfaceOrientation:duration:

Methods inherited from UIResponder

#becomeFirstResponder, #canBecomeFirstResponder, #canPerformAction:withSender:, #canResignFirstResponder, #isFirstResponder, #motionBegan:withEvent:, #motionCancelled:withEvent:, #motionEnded:withEvent:, #nextResponder, #reloadInputViews, #remoteControlReceivedWithEvent:, #resignFirstResponder, #touchesBegan:withEvent:, #touchesCancelled:withEvent:, #touchesEnded:withEvent:, #touchesMoved:withEvent:

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (Object) dataSource

The object that provides view controllers. Methods of the data source are called in response to gesture-based navigation. If the value of this property is nil, then gesture-based navigation is disabled.

Returns:

- (Object) delegate

The delegate object. Methods of the delegate are called in response to gesture-based navigation and orientation changes.

Returns:

- (Boolean) doubleSided

A Boolean value that indicates whether content appears on the back of pages. The default value for this property is NO.If the back of pages has no content (the value is NO), then the content on the front of the page will partially show through to the back when turning pages.If the spine is located in the middle, the value must be YES. Setting it to NO with the spine located in the middle raises an exception.

Returns:

  • (Boolean)

- (Array) gestureRecognizers (readonly)

An array of UIGestureRecognizer objects that are configured to handle user interaction. (read-only) These gesture recognizers are initially attached to a view in the page view controller’s hierarchy. To change the region of the screen in which the user can navigate using gestures, they can be placed on another view.

Returns:

The direction along which navigation occurs. (read-only)

Returns:

  • (UIPageViewControllerNavigationOrientation)

- (UIPageViewControllerSpineLocation) spineLocation (readonly)

The location of the spine. (read-only) The value of this property is set with the UIPageViewControllerOptionSpineLocationKey key when the page view controller is initialized, and can be changed by returning the new value from the pageViewController:spineLocationForInterfaceOrientation: method of the delegate.

Returns:

  • (UIPageViewControllerSpineLocation)

- (UIPageViewControllerTransitionStyle) transitionStyle (readonly)

The style used to transition between view controllers. (read-only) The value of this property is set when the page view controller is initialized, and cannot be changed.

Returns:

  • (UIPageViewControllerTransitionStyle)

- (Array) viewControllers (readonly)

The view controllers displayed by the page view controller. (read-only)

Returns:

Instance Method Details

- (Object) initWithTransitionStyle(style, navigationOrientation:navigationOrientation, options:options)

Initializes a newly created page view controller. After initialization, use the setViewControllers:direction:animated:completion: method to set the initial view controllers.

Parameters:

  • style (UIPageViewControllerTransitionStyle)

    The style for transitions between pages.

  • navigationOrientation (UIPageViewControllerNavigationOrientation)

    The orientation of the page-by-page navigation.

  • options (Hash)

    A dictionary of options. For keys, see “Options Keys.”

Returns:

  • (Object)

    The initialized page view controller.

- (Object) setViewControllers(viewControllers, direction:direction, animated:animated, completion:completion)

Sets the view controllers to be displayed. The view controllers passed to this method are those that will be visible after the animation has completed. Use a data source to provide additional view controllers to which users navigate.If the transition style is UIPageViewControllerTransitionStylePageCurl, the view controllers to pass in the viewControllers parameter depends on the spine location and the value of the doubleSided property:Spine locationDouble sidedWhat to passUIPageViewControllerSpineLocationMidYESPass the page to be displayed on the left and the page to be displayed on the right.UIPageViewControllerSpineLocationMin or UIPageViewControllerSpineLocationMaxYESPass the front of the page to be displayed and the back of the previously-displayed page. The back is used for the page turning animation.UIPageViewControllerSpineLocationMin or UIPageViewControllerSpineLocationMaxNOPass the front of the page to be displayed.

Parameters:

  • viewControllers (Array)

    The view controller or view controllers to be displayed.

  • direction (UIPageViewControllerNavigationDirection)

    The navigation direction.

  • animated (Boolean)

    A Boolean value that indicates whether the transition is to be animated.

  • completion (Object)

    A block to be called when the page-turn animation completes.The block takes the following parameters:finishedYES if the animation finished; NO if it was skipped.

  • finished (BOOL finished)

    YES if the animation finished; NO if it was skipped.

Returns: