APPagedScrollView
public class APPagedScrollView: UIScrollView, UIScrollViewDelegate
The main paged scroll view class, which allows for an automatic layout of the content provided by the data source and delegates.
-
A data source for the paging scroll view.
Declaration
Swift
weak public var dataSource: APPagedScrollViewDataSource?
-
The delegate to use for APPagedScrollView events.
Declaration
Swift
weak public var pagingDelegate: APPagedScrollViewDelegate?
-
Where to send normal UIScrollView events.
Declaration
Swift
var receivingDelegate: UIScrollViewDelegate?
-
Align the current page of the scroll view to the closest or most appropriate one.
If you have a view controller that could rotate, implement this method in your UIViewController’s viewWillTransition(to:, with:) and pass along the coordinator so that we can adjust the scroll view’s page for rotations.
Declaration
Swift
public func alignScrollView(with coordinator: UIViewControllerTransitionCoordinator? = nil)
Parameters
coordinator
Specify a transition coordinator to animate alongside, making it look seamless for events like device rotations or animated view size changes.
-
Reloads the pages of the scroll view.
Declaration
Swift
public func reloadData()
-
The index of the current page.
Declaration
Swift
public var currentPageIndex: Int
-
Whether or not to have movedTo: events include elastic scrolling
Declaration
Swift
public var elasticScrollingEvents = false
-
Scrolls to the page with the provided index.
Declaration
Swift
public func scroll(to index: Int, animated: Bool)
Parameters
index
The index of the page to scroll to.
animated
Whether or not to animate this change.
-
Whether or not the scroll view is currently in a position to go forward
Declaration
Swift
public var canGoForward: Bool
-
Whether or not the scroll view is currently in a position to go back
Declaration
Swift
public var canGoBack: Bool
-
Scroll forward one page, if possible.
Declaration
Swift
public func goForward(animated: Bool = true)
-
Scroll back one page, if possible.
Declaration
Swift
public func goBack(animated: Bool = true)
-
The number of pages within this scroll view.
Declaration
Swift
public var numberOfPages: Int