Hello! There was a need to write "hands" transition (by clicking the button) between several ViewControllers (the transition should be carried out when a certain condition is met).

Closed due to the fact that the issue is too general for the participants Max Mikheyenko , Bald , user194374, Denis Bubnov , aleksandr barakin 22 Dec '16 at 20:04 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • and what is the problem? - VAndrJ
  • The code is needed) I can get through the storyboard, but it will not be correct. - Igor Zexyy
  • what you tried, what did not work? - Max Mikheyenko
  • You just need to make the transition when a certain condition is met. Or rather, after the appearance of a pop-up window informing the user called by the button. Thus, the button itself can not be disabled, and the transition should not be carried out when the condition is not met. That is the simplest thing to write a "transition" with your hands in the right part of the code. I think there are 1-2 lines of code. No more. - Igor Zexyy
  • Would you at least have what is at the moment. What want exactly the condition, as organized into the interface of the builder, etc. - VAndrJ

1 answer 1

Swift 3 in the storyboard in the second controller where you want to go, specify in identity - YourVC , where Main is the name of the storyboard.

depending on the condition of my class and change identity accordingly

 let sb = UIStoryboard(name: "Main", bundle: nil) let initialVC = sb.instantiateViewController(withIdentifier: "YourVC") self.present(initialVC, animated: false, completion: nil) 

enter image description here

  • Works!!!!!!! - Igor Zexyy