iOS頁面控制:PageController

jopen 9年前發布 | 24K 次閱讀 iOS開發 移動開發 PageController

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

iOS頁面控制: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)
        }
    }
}

項目主頁:http://www.baiduhome.net/lib/view/home/1436521108130

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!