StefanLage / SLPagingView

Navigation bar system allowing to do a Tinder like or Twitter like
MIT License
1.01k stars 85 forks source link

How to use this with ViewControllers instead of Views ? #4

Closed hiroshihorie closed 9 years ago

hiroshihorie commented 9 years ago

Very nice project I was looking for but, How to use this with ViewControllers instead of Views ?

StefanLage commented 9 years ago

Actually there is two ways for doing this, if you just want to put some UIViewController without customising the navigation bar you can implement using those constructors:

-(id)initWithNavBarControllers:(NSArray *)controllers
-(id)initWithNavBarControllers:(NSArray *)controllers showPageControl:(BOOL)addPageControl
-(id)initWithNavBarControllers:(NSArray *)controllers navBarBackground:(UIColor *)background showPageControl:(BOOL)addPageControl

Those three initialisers take the controller’s title as the navigation bar’s title.

Otherwise if you want to customise the navigation’s items you can use one of those three constructors:

-(id)initWithNavBarItems:(NSArray *)items controllers:(NSArray *)controllers
-(id)initWithNavBarItems:(NSArray *)items controllers:(NSArray *)controllers showPageControl:(BOOL)addPageControl
-(id)initWithNavBarItems:(NSArray *)items navBarBackground:(UIColor *)background controllers:(NSArray *)controllers showPageControl:(BOOL)addPageControl
hiroshihorie commented 9 years ago

Sweet