UIPageViewController

页面视图控制器让用户以翻书的形式滑动页面,每一页都有自己的UIViewController。我们可以使用自己的方式过渡动画。

相关类逻辑如图所示。

Creating Page View Controllers

// 初始化
public init(transitionStyle style: UIPageViewControllerTransitionStyle, navigationOrientation: UIPageViewControllerNavigationOrientation, options: [String : AnyObject]?)
// 导航代理
weak public var delegate: UIPageViewControllerDelegate?
// 数据源代理
weak public var dataSource: UIPageViewControllerDataSource?

Providing Content

// 所有手势
public var gestureRecognizers: [UIGestureRecognizer] { get }
// 当前显示的UIViewController
public var viewControllers: [UIViewController]? { get }
// 替换UIViewController
public func setViewControllers(viewControllers: [UIViewController]?, direction: UIPageViewControllerNavigationDirection, animated: Bool, completion: ((Bool) -> Void)?)

Display Options

// 过渡动画
public var transitionStyle: UIPageViewControllerTransitionStyle { get }
// 水平或垂直方向变化
public var navigationOrientation: UIPageViewControllerNavigationOrientation { get }
// 脊柱的位置,如果transitionStyle=PageCurl,spineLocation默认为Min
public var spineLocation: UIPageViewControllerSpineLocation { get }
// 是否多页面显示,如果spineLocation为Mid,doubleSide必须设置为true
public var doubleSided: Bool

 

Appendix

UIPageViewController Class Reference

View Controller Catalog for iOS

Revision History

时间 描述
2016-05-03 博文完成

CSDN:http://blog.csdn.net/y550918116j

GitHub:https://github.com/937447974

你可能感兴趣的:(UIPageViewController)