iOS頁面控制:PageController
PageController 是無限頁面控制器,可以滾動內容和標題欄,而且帶有滾動延遲功能。

Requirements
- iOS 8.0+
Features
- To inherit from DCScrollView
- UseUIViewController, notUIViewlikeUITabBarController
- Scrolling smoothly and effortlessly
- Support AutoLayout about MenuCell
- Handling to change current view controller with Delegate.
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects.
To integrate PageController into your Xcode project using CocoaPods, specify it in yourPodfile:
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! pod 'PageController'
Then, run the following command:
$ pod install
Usage
viewControllers
Type is [UIViewController], and element must have title.
import PageController class CustomViewController: PageController { override func viewDidLoad() { super.viewDidLoad() viewControllers = createViewControllers() } func createViewControllers() -> [UIViewController] { var viewControllers = [UIViewController]() let names = [ "Home", "Innovation", "Technology", "Life", ] for name in names { let viewController = ItemsCollectionViewController() viewController.title = name viewControllers.append(viewController) } } }
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!