cwRichardKim / RKSwipeBetweenViewControllers

Swipe between ViewControllers like in the Spotify or Twitter app with an interactive Segmented Control in the Navigation Bar
MIT License
1.67k stars 156 forks source link

i want to add a back button on the nav Bar #40

Closed ritesh124 closed 7 years ago

ritesh124 commented 7 years ago

Hi Sir,

First of all this is amazing and its easy to use, Thanks.

I would like to know how do i add a back button, because doing the same on the storyboard moves the name of the controllers to the right where i want to show the cancel or back button.

Also when i try to change the height of navBar to show my cancel button, the buttons are moved more upwards. So now the changes has to be done in :

UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(X_BUFFER+i*(self.view.frame.size.width-2*X_BUFFER)/numControllers-X_OFFSET, Y_BUFFER, (self.view.frame.size.width-2*X_BUFFER)/numControllers, HEIGHT)];

 [navigationView addSubview:button];

Is there any other way around.

Thanks in Advance.

ritesh124 commented 7 years ago

i am Sorry, my brain just worked, off course i can add the buttons to another view. [anotherView addSubview:button]; Thanks