Reputation: 2597
I am stuck in my code. I can't make it to go to the other view when a user logins.
I have a class UILoginClass (Tableviewcontroller) And a class ImageViewController (viewcontroller).
Check image below.
I want to get from UILoginClass to ImageViewController but i can't make it. Anyone help?
Upvotes: 0
Views: 94
Reputation: 684
1) Create a "push" segue from the view controller of the login screen to the image view controller (press ctrl and drag from source view controller icon to the destination view controller).
2) Give that segue an identifier (click on the seque in IB --> attributes inspector --> identifier. It is just a string identifier that allows you to initiate that segue when you want to.
3) In code, when the login is validated, call performSegueWithIdentifier:sender: with the identifier you gave to the segue.
Upvotes: 1
Reputation: 1913
It sounds like what you want is a push segue from Login Class to Image View Controller. In the Xcode storyboard you add a segue by ctrl-clicking in the source and dragging to the destination. Be sure to give the segue a name. Then in the Login Class you can call the UIViewController method performSegueWithIdentifier:sender:.
Oh, and you can get rid of the push segue from your navigation controller to Image View Controller.
Upvotes: 0