Flipbook
Example
To run the example project, clone the repo, and run pod install from the Example directory first.
Requirements
Installation
Flipbook is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Flipbook'Usage
override func viewDidLoad() {
super.viewDidLoad()
var images:[String] = [String]()
for i in 1...5 {
images.append("image\(i)")
}
let flipbook:Flipbook = Flipbook(withImages: images)
addChild(flipbook)
view.addSubview(flipbook.view)
flipbook.view.expandToParent(view)
flipbook.didMove(toParent: self)
}Images can be an array of UIImages, Strings or URLs.
Configuration
The following options are customisable and should be set before you add the view.
contentMode:UIView.ContentMode: The content mode of theUIImageViewused to display an image. Defaults to.scaleAspectFilltransitionStyle:UIPageViewController.TransitionStyle: The transition style used when paging through images. Defaults to.scrolldirection:UIPageViewController.NavigationDirection: The navigation direction of the page controller. Defaults to.forwardorientation:UIPageViewController.NavigationOrientation: The navigation orientation of the page controller. Defaults to.horizontaloptions:[UIPageViewController.OptionsKey:Any]: Any options to pass to the page view controller on creation. Defaults tonilanimated:Bool: Whether the page view controller should use animations. Defaults totruepageControlActiveTint:UIColor: The colour to use for the active dot. Defaults toUIColor.blackpageControlInactiveTint:UIColor: The colour to use for the inactive dots. Defaults toUIColor.lightGray
Author
OiNutter, [email protected]
License
Flipbook is available under the MIT license. See the LICENSE file for more info.