Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Xcode/Swift assistance

  • 19-05-2015 08:52PM
    #1
    Registered Users, Registered Users 2 Posts: 486 ✭✭


    I looked for advice a month or so ago about what to use to create an app I am designing/developing for a college dissertation project. See here.

    I tried PencilCase but found it too limiting, and as it is so new, there is not a lot of tutorials out there on the web. So I am using Xcode now and as I am adding the scenes, I am coming across all sorts of questions, as Xcode and Swift are all new to me.

    I have got a number of screens up and running, starting with a single view controller project and adding on, with others views and tab bar controllers etc... I even have got a map working displaying the current location. But there are other elements I am struggling with. I am working through tutorials on the web and find they are taking up a lot of time but not necessarily covering totally relevant material for my project, and I am tight on time!

    So may I ask some questions? I'll start with one!

    I have created segues to link screens but the problem I am having is trying to create a 'back' button on one screen. You can arrive at this screen from three other screens, and I need the back button to bring me back to the screen I came from, so I can't just jump back one in the list. If you look at the diagram, I can get to the Detail screen from A,B and C and I want to place a back button in the top navigation of the Detail screen to bring me back to whichever of A,B or C I came from.

    sample.png

    I think it is something like this (found in online tutorial)?

    @IBAction func cancelToPlayersViewController(segue:UIStoryboardSegue) {

    }

    I would really appreciate some help!!


Comments

  • Registered Users, Registered Users 2 Posts: 13 BillUnder


    A, B and C should be inside a UINavigationController. Drag out 3 navigation controllers onto the storyboard. They automatically come with a root view controller. Delete the default root view controllers and replace them with A, B and C. The tab bar controller should now link to the navigation controllers. Then in A, B and C create a "Show (push)" segue to "Detail". You will now get a back button in the navigation bar when you show the "Detail" screen.


  • Registered Users, Registered Users 2 Posts: 486 ✭✭curiousb


    That's great, thanks for your help, I will try that out later today.


Advertisement