Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created June 13, 2019 17:35
Show Gist options
  • Save vialyx/7646da5352f6aca343e73af34a42e592 to your computer and use it in GitHub Desktop.
Save vialyx/7646da5352f6aca343e73af34a42e592 to your computer and use it in GitHub Desktop.
import UIKit
extension Segue {
static var signup: Segue = Segue(identifier: "signup")
}
class OBEmailViewController: UIViewController {
// Some code
// Actions
@IBAction func next(_ sender: Any) {
perform(segue: .signup)
}
// Navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// That way is straight forward without grammar mistakes
if segue.equal(.signup),
let vc = segue.destination as? OBSignupViewController {
vc.email = emailTF.text
}
}
// Some code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment