Advertisement
iamalizade

Untitled

Mar 3rd, 2016
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.56 KB | None | 0 0
  1. protocol SegueDelegate {
  2.     func runSegue(identifier: String)
  3. }
  4.  
  5. class SignUpView: UIView {
  6.     var delegate: SegueDelegate?
  7.  
  8.     @IBAction func signUp(sender: AnyObject) {
  9.         delegate?.runSegue("goToMainPage")
  10.     }
  11. }
  12.  
  13.  
  14. -----------
  15.  
  16. class WelcomeViewController: UIViewController, SegueDelegate {
  17.  
  18.     var a = SignUpView()
  19.    
  20.     override func viewDidLoad() {
  21.         super.viewDidLoad()        
  22.         a.delegate = self
  23.     }
  24.  
  25.     func runSegue(identifier: String) {
  26.         self.performSegueWithIdentifier(identifier, sender: self)
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement