CRPageViewController
Hey, guys! Cleveroad team has got something really interesting for you. Meet our new iOS library - CRPageViewController. We’re sure that you’ve already checked the convenience of Page View long time ago. But we’ve made something that will make navigation between pages of your app even handier.
While a standard page view allows you to navigate between pages by using simple gestures, our component goes further. CRPageViewController allows defining a page size by setting width and heights manually. Thus, users will be able to control the placement of pages on the screens in the way which is more suitable for them.
We’re convinced that users will find this component really useful and will be grateful for such a good tool.
Requirements
- iOS 8 or higher
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Installation
CRPageViewController is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod "CRPageViewController"
and run pod install in terminal.
Usage
@protocol CRPageViewControllerDataSource <NSObject>
@required
//Returns the view controller after the given view controller.
- (UIViewController *)pageViewController:(CRPageViewController *)pageViewController
viewControllerAfterViewController:(UIViewController *)viewController;
//Returns the view controller before the given view controller.
- (UIViewController *)pageViewController:(CRPageViewController *)pageViewController
viewControllerBeforeViewController:(UIViewController *)viewController;
@optional
//ViewController moving to center PageController
- (void)focusedViewController:(UIViewController *)viewController;
//ViewController moving from center PageController
- (void)unfocusedViewController:(UIViewController *)viewController;
CRPageViewController
//DataSourse of PageViewController
@property (weak, nonatomic) id <CRPageViewControllerDataSource> dataSource;
//Starting array of UIViewController in PageViewController
@property (strong, nonatomic) NSArray <UIViewController*> *viewControllers;
//Size of UIViewController in PageViewController
@property (assign, nonatomic) CGSize childVCSize;
//Vertical offset of UIViewController in center screen
@property (assign, nonatomic) CGFloat OffsetOfHeightCentralVC;
//Distance between child UIViewController
@property (assign, nonatomic) CGFloat sizeBetweenVC;
//Speed of animation change UIViewController on center PageViewController
@property (assign, nonatomic) CGFloat animationSpeed;
//Type of animation change UIViewController on center PageViewController
@property (assign, nonatomic) UIViewAnimationCurve animation;
//Count of UIViewController on PageViewController
@property (assign, nonatomic) NSInteger countPageInController;
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.