DMPage Controller built with Swift
DMPageController
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
- Swift 5.0
- XCode 14.3(14E222b)
- iOS 15.0 (Min SDK)
- Not Use Autolayout
How to used
import JMPageController
public enum PageContollerType {
case DMNormal
case DMMoveSlide
case DMCustomSlide(size: CGSize)
}
let pageController: DMPageControlView = {
let view = DMPageControlView()
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
//SetUp Page Controller
pageController.setView(pages: 5, pageContollerType: .JMNormal)
//Add Page Controller
self.view.addSubview(pageController)
//SetUp Layout
NSLayoutConstraint.activate([
pageController.centerXAnchor.constraint(equalTo: self.view.centerXAnchor),
pageController.centerYAnchor.constraint(equalTo: self.view.centerYAnchor)
])
}
@IBAction func nextButton(_ sender: Any) {
//The page is the index value you want to move.
pageController.changePage(page)
}
Installation
DMPageController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'DMPageController'
Author
License
JMPageController is available under the MIT license. See the LICENSE file for more info.