Swift: How can I add & amp; Buttons down & amp; Functionality on a detailed view controller?

advertisements

I am a neewbie to app development (and coding in general) but enjoying the journey :-)

(I am using Xcode 6.4) I have a table view controller with prototype cell embedded in a navigation controller..clicking on a row leads to the detail view controller. Everything working fine.

I'm interested in having up and down buttons on the 'Detail View Controller' to save someone from having to go back up and then down to the next detail again...so they just move between detailed views..

Any pointers... as I can't even drag a button to the nav bar on the detail view controller itself let alone start thinking about how to code the function :-)

Many thanks for your time!

PS can't post a pic of the storyboard as only just joined stackoverflow


I am afraid you are gonna have to do that programmatically.

First, add multiple buttons on nav bar by following this. And hook up these buttons in your detail view controller.

Then, in each of your detail view controller, you need to have some property like previous item, next item. In prepare segue, pass these items from main view controller.

Finally, in the actions of the buttons, load previous/next item.

This is what I can think of based on your description, hope it helps.