Description
ninaPageView is a customizable page view controller for iOS. It allows the user to easily navigate between multiple child view controllers in a horizontal swipe gesture based interface.
Features
- Highly customizable page view controller for iOS.
- Supports horizontal swipe gestures for easy navigation.
- Customizable page indicators for visual feedback on current page.
- Supports both landscape and portrait orientations.
- Efficient memory management through view controller recycling.
- Supports autolayout and interface builder.
- Delegate methods for additional customization and interaction handling.
Installation
To install ninaPageView using CocoaPods, add the following line to your Podfile:
pod 'ninaPageView'
If you prefer Carthage, add the following line to your Cartfile:
github "ninastjerneklar/cocoapod-template" ~> 1.0
Getting Started
To start using ninaPageView, first import the framework:
import ninaPageView
Then, initialize a ninaPageViewController and set the child view controllers:
let pageViewController = ninaPageViewController()
pageViewController.setViewControllers(viewControllers, direction: .forward, animated: true, completion: nil)
You can customize the appearance of the page view controller by modifying its properties:
pageViewController.pageIndicatorTintColor = UIColor.gray
pageViewController.currentPageIndicatorTintColor = UIColor.blue
pageViewController.pageIndicatorHeight = 10
// ...
Finally, add the page view controller’s view to your view hierarchy:
addChild(pageViewController)
view.addSubview(pageViewController.view)
pageViewController.didMove(toParent: self)
How to Use
ninaPageView provides several delegate methods for customization and interaction handling. Some important delegate methods are:
func ninaPageViewController(ninaPageViewController: ninaPageViewController, willTransitionTo viewController: UIViewController)
Called when the page view controller is about to transition to a new child view controller. Use this method to prepare the child view controller for display.
func ninaPageViewController(ninaPageViewController: ninaPageViewController, didTransitionTo viewController: UIViewController)
Called when the page view controller has finished transitioning to a new child view controller. Use this method to perform any necessary actions after the transition.
func ninaPageViewController(ninaPageViewController: ninaPageViewController, didSelectPageWith index: Int)
Called when a page is selected by the user. Use this method to handle page selection events.
Contribution
This project welcomes contributions from the open-source community. If you have any ideas, suggestions, or bug reports, please create an issue or submit a pull request on the GitHub repository.
License
ninaPageView is released under the MIT License. See the LICENSE file for more details.