-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to have pagination? #14
Comments
This is a great idea! We'd welcome a pull request for it, but not something we're planning to work on soon. |
+1 |
2 similar comments
+1 |
+1 |
You can add a UIPageControl manually and wire it up manually like so: class PagedViewController: AnimatedPagingScrollViewController {
// Set this up using your preferred method, make sure it's on all pages
private let pageControl: UIPageControl
override func scrollViewDidScroll(scrollView: UIScrollView) {
super.scrollViewDidScroll(scrollView)
pageControl.currentPage = Int(pageOffset + 0.5)
}
} I add 0.5 to the offset so that the page control changes right in between pages. Edit: Added |
as @andreyrd showed it is actually super easy to add a UIPageControl. I did so myself (just never managed to post it here). Therefor my suggestion is to not add a build in |
Adding ruins the animations.. At least it does for me.. So any other suggestions? :) |
Here what I did previously, hope that would help, @IBOutlet weak var introPageControl: UIPageControl!
// Page Change Listener
internal override func scrollViewDidScroll(_ scrollView: UIScrollView) {
super.scrollViewDidScroll(scrollView)
let screenSize: CGRect = UIScreen.main.bounds
if scrollView.contentOffset.x.truncatingRemainder(dividingBy: screenSize.width) == 0 {
let index = scrollView.contentOffset.x / screenSize.width
// Set the new page index to the page control
introPageControl.currentPage = Int(index)
}
} |
Hi i was wondering if you've developed pagination within the framework so that there's circles at the bottom of the screen to show the user the current view which they are on? Like the image attached.
The text was updated successfully, but these errors were encountered: