I'm new with iOS development and I'm having a few problems to navigate to another view when using the iCarousel implementation of a cover flow component.
I'm able to create the carousel and put buttons on it. I'm also able to interact with this buttons and call a specific method to execute some code. My problem is that I'm trying to navigate to another view when clicking on this buttons. I've already made one application using storyboard and I was able navigate through views with no problems, but in that case all the buttons were displayed in the storyboard canvas, so I was able to use the UI to create this interaction using the - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender method. This is not the case with the iCarousel. The buttons are created via code and are not displayed in the canvas UI.
I already created a Navigation Controller and placed the iCarousel inside of it. But now I need to navigate to another view when clicking the iCarousel buttons.
I'm calling this method when clicking the buttons:
- (void)buttonTapped:(UIButton *)sender
{
NSInteger index = [carousel indexOfItemViewOrSubview:sender];
switch(index) {
case 0:
break;
case 1:
break;
}
}
Theres a way to create manually the interation segues between the iCarousel view and the new view to be showed when pressing a button?
PS: I'm looking for something similar with this for a while, but i didn't find anything that helps me.
I've found a solution. I created a segue between the source view and the target view then, in the the button action method, I've called [self performSegueWithIdentifier:@"SegueID" sender:self];