MIPivotPageController allows switching view controllers with an horizontal swipe
MIPivotPageController allows switching view controllers with an horizontal swipe
MIPivotPageController.get(rootPages: [viewControllerA, viewControllerB, viewControllerC])
MIPivotPageController.get(rootPages: [viewControllerA, viewControllerB, viewControllerC]) {
$0.menuView.backgroundColor = myBlueColor
$0.menuView.layer.shadowColor = UIColor.black.cgColor
$0.menuView.layer.shadowOpacity = 0.3
$0.menuView.layer.shadowOffset = CGSize(width: 0, height: 2)
$0.setMenuHeight(60)
$0.setLightStatusBar(true)
}
func imageForPivotPage() -> UIImage?
There're also two usefull method like
func rootPivotPageDidShow()
func rootPivotPageWillHide()
that are called when a page in showed and when it's about to hide.
func shouldShowPivotMenu() -> Bool { return true }
func pivotPageShouldHandleNavigation() -> Bool { return true }
If the first one return false, the menu will not be visible on that view controller. If the second one return false, the swipe (to the other root pivot pages) will be disabled for that view controller.
For a better understanding of those methods see the navigationController example in the demo.
In this repository you can also find a demo.
If you like this git you can follow me here or on twitter :) @MarioIannotta
Cheers from Italy!