I have two buttons with objects *tmpltLeft
and *tmpltRight
. When i launch my app, i want the previous button(tmpltLeft
) initially to be hidden and when i press the next button(tmpltRight
) i want the previous button(tmpltLeft
) to be displayed and when the next button(tmpltRight
) reaches page 20(last page) I want the next button(tmpltRight
) to be hidden.
I have in .h file
IBOutlet UIButton *tmpltLeft, *tmpltRight;
In .m file
-(IBAction)templateNavigationBtnTapped:(UIButton*)sender {
UIButton *button=sender;
switch (button.tag) {
case 1:
NSLog(@"prev btn tapped");
if (pageNo>1) {
pageNo--;
}
break;
case 2:
NSLog(@"next btn tapped");
if (pageNo<18) {
pageNo++;
}
break;
default:
break;
}