Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Xcode/Swift assistance

Options
  • 19-05-2015 8:52pm
    #1
    Registered Users 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 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 Posts: 486 ✭✭curiousb


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


Advertisement