0

Newbie to iOS here. I have a question about designing an app. I wonder if Im doing it in the right way or if there are other, better, ways to do what Im doing.

I have a login page. So in Storyboard there is a LoginViewController. I connected login view in storyboard with a segue to Home view. The performing of segue is done programmatically when button is clicked, as I need to be sure username/password are correct. I used ”modal” segue. is that good? I don’t think I need Navigation Controller and it seems it is required in order to have segues with push.

Then there is another View in the storyboard: Settings. I connected a button from Home to this view with modal segue.

When settings view appear it contains a button for doing logout. Of what I understood I needed to connect this view to the Login view. Is that correct? Because when one logs out he need to go back to login page, right?

Also, on setting page there will be a ”Cancel” button that will take the user back to the home screen. So even here Im planning to have a segue (automatic) from setting screen to home screen.

Is this the right way to go? I have not read that much about IOS-theory but mostly looking at tutorials. Im just wondering if there are better ways to do what IM doing. I come from web development world. In html/javascript you would probably ”hide”, ”dismiss” views. Here you need to connect all the time.

user1963937
  • 185
  • 1
  • 5
  • 12
  • 1
    Is *what* the right way to go? All of it? It *sounds like* your use of segues is fine -- segues simply provide ways to transition from one view controller to another. But it's hard to say whether your whole app design is good or not based on a very brief, rather vague description, and in any case it's too broad and subjective a question. If it works the way you want, great. If you're having trouble with something specific, that's the kind of question that works best on SO. – Caleb Apr 06 '14 at 01:28

1 Answers1

1

You need to learn about "Unwind Segues"

Read the accepted answer from here. What are Unwind segues for and how do you use them?

You can see how to create an unwind segue and how to call this programatically is what you need to do.

Community
  • 1
  • 1
John Ballinger
  • 7,380
  • 5
  • 41
  • 51