PageController is infinite paging controller, scrolling through contents and title bar scrolls with a delay. Then it provide user interaction to smoothly and effortlessly moving. It is for iOS written in Swift.
![sample](Example project/example.gif)
- iOS 8.0+
- Xcode 7.0+
PageController | Xcode | Swift |
---|---|---|
0.2.0 | 6.4 | 1.2 |
0.3.x | 7.0+ | 2.0 |
0.4.x | 8.0 | 2.2 |
- To inherit from DCScrollView
- Use
UIViewController
, notUIView
likeUITabBarController
- Support AutoLayout about MenuCell
- Handling to change current view controller with Delegate.
- Scrolling smoothly and effortlessly
- Keep to smoothly in scrolling contents too much
CocoaPods is a dependency manager for Cocoa projects.
To integrate PageController into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'PageController'
Then, run the following command:
$ pod install
viewControllers
Type is [UIViewController], and element must have title.
import PageController
class CustomViewController: PageController {
override func viewDidLoad() {
super.viewDidLoad()
viewControllers = createViewControllers()
}
func createViewControllers() -> [UIViewController] {
let names = [
"favorites",
"recents",
"contacts",
"history",
"more",
]
return names.map { name -> UIViewController in
let viewController = ContentViewController()
viewController.title = name
return viewController
}
}
}
MenuBar
Enable to change backgroundColor, frame and MenuCell.
menuBar.backgroundColor = UIColor.whiteColor().colorWithAlphaComponent(0.9)
menuBar.registerClass(CustomMenuCell.self)
MenuCell
- constentInset
Margins between cells are zero, because it is difficult that calculating distance of scrolling. If you change margins between cell's labels or vertical position, use constentInset.
- updateData()
If property cell's selected is changed, updateData()
is called. You customize animations of activate to dis-activate, or dis-activate to activate, implement as override updateData()
.
PageController is available under the MIT license.