I have a main view controller which is a tableview, after selecting a cell from the table view, another view is displayed. How can I create buttons to access and display the next and previous cell’s view? I have the toolbar and buttons set, I just need help with the code to access and push the next view.
Share
If you pass the data for the
tableView(presumably an array containing info for the cells) to yourdetailViewController, then you can navigate through the items that way.When you select a row, send the
indexPath.rowto thedetailViewControlleras a property, e.g.int selectedRow. Then wire up two buttons, one that decrements this parameter and another that increments it.