Skip to content

iospro/AMPageViewController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Swift 4.0 Platform: iOS XCode 8+ iOS 8 Licence MIT

AMPageViewController

Convenient subclass of UIPageViewController

Features

Usage examples

  • Swift
// Create array of pages
let source: [UIViewController] = ...  
// Create pageController with interPageSpacing
let pageController = AMPageViewController(interPageSpacing: 2)

// Set looping mode
pageController.looping = true

// Shows pageControl
pageController.showPageControl = true

// Allows to handle UITableView cell swipes within pages
pageController.allowsTableCellSwipes = true

// Allows bounces for edge pages
pageController.bounceEnabled = true

// Set viewController to show by pageIndex between 0 and source.count
pageController.pageIndex = 0

// Set source array
pageController.source = source

// Then set delegate to observe navigation
pageController.delegate = ...
  • Objective-C
// Create array of pages
NSArray<UIViewController *> *source = ...;
AMPageViewController *pageController = [[AMPageViewController alloc] initWithNavigationOrientation:UIPageViewControllerNavigationOrientationHorizontal interPageSpacing:2];
pageController.looping = YES;
pageController.allowsTableCellSwipes = YES;
pageController.bounceEnabled = YES;
pageController.showPageControl = YES;
pageController.source = source;
pageController.pageIndex = 0;
pageController.delegate = ...;

Installing

Manually

Download and drop AMPageViewController.swift file in your project.

Requirements

  • Swift 5
  • iOS 10 or higher

Authors

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

License

This project is licensed under the MIT License.

About

Swift convenient subclass of UIPageViewController with cycle mode free from crashes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages