simple and elegant paging view with UITableView Style memory preserving reusability functionality
using cocoapods
pod 'HBRPagingView', '~> 0.3.0'
using cartage
github "Ryce/HBRPagingView" >= 0.3.0
set delegate and datasource, register your class (you can also use the basic HBRPagingViewPage)
self.pagingView?.dataSource = self
self.pagingView?.pagingDelegate = self
self.pagingView?.registerClass(CustomPagingViewPage.self, forPageReuseIdentifier: "identifier")
datasource should return number of pages and the page, dequeueing is available and should be used
// MARK: - PagingView Delegate & DataSource
func numberOfPages(pagingView: HBRPagingView) -> UInt {
return 6
}
func pagingView(pagingView: HBRPagingView, viewForPage index: UInt) -> AnyObject {
let page = pagingView.dequeueReusablePageWithIdentifier("identifier", forIndex: index) as! PagingViewPage
page.imageView.image = UIImage(named: "\(index)")
return page
}
HBRPagingView is available under the MIT license. See the LICENSE file for more info.