JLCustomPagingView 0.1.5

JLCustomPagingView 0.1.5

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2016
SPMSupports SPM

Maintained by Jose Lucas.



  • By
  • José Lucas

JLCustomPagingView

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

JLCustomPagingView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "JLCustomPagingView"

Initial Configurations

First Step

Import it on every file that use this framework.

import JLCustomPagingView
Second Step

Go to the storyboard that has the View Controller you want to have an instace of JLCustomPagingView add a view to your view Controller, put all of the constraints you want, after you have to say that view is a JLCustomPagingView and create an outlet of this JLCustomPagingView.

@IBOutlet weak var myPagingView: JLCustomPagingView!
Third Step

After you create the corresponding outlet you should implement the protocols CustomPagingViewDataSource and CustomPagingViewDelegate.

class ViewController: UIViewController,CustomPagingViewDataSource,CustomPagingViewDelegate

Quick Tips

Reloading Data
reloadData()
CustomPagingViewDataSource methods

The number of items you want it to have

numbOfItems()->Int

The item that should stay at index

itemAtIndex(index:Int)->UIView!
CustomPagingViewDelegate methods

This method is called to know if the item at corresponing index should recognize tap events

shouldItemReceiveTapEvents(ItemAtIndex index:Int)->Bool

This method is called when the user taps on the top item

didSelectItemWithIndex(index:Int,item:UIView)

This method is called when the top visible item, so the actived one changes

didChangeTopItemIndexTo(newTopItemIndex:Int,lastTopItemIndex:Int)

Author

José Lucas

License

JLCustomPagingView is available under the MIT license. See the LICENSE file for more info.