Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
461 views
in Technique[技术] by (71.8m points)

objective c - Conditionally following a segue

In my app I have a login screen. When connecting a segue from the login button to the next (table) view controller however, you are always able to proceed, no matter what you type in as login information. How can I check the login information and then decide whether to perform the segue or not, so how to perform the segue conditionally?

Is it possible to achieve this while working with a segue? I know it can be done programmatically, but then I need another navigation controller cause I need a navigation bar..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can wire up your login button or whatever to some IBAction code, decide if the login should proceed and then (if it should) you can use performSegueWithIdentifier: to transition to the new view.

I just wrote another post about using this method, here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...