How to open another viewControler in Swift?

2

I'm new to swift programming and I have a question. I have two files The main one: ViewController.swift and another one that I created called ViewSecond.swift.

I made the class

import UIKit

class ViewSegundo: UIViewController {

    @IBOutlet weak var img4: UIImageView!

    override func viewDidLoad() {


    }
}

    
asked by anonymous 23.09.2015 / 03:33

1 answer

1

To open a new controller you need to write like this within the click event of a button:

 self.performSegueWithIdentifier("SegundaViewController", sender:self)

You can also do in visual form, which would be dragging the button to the view and selecting push

    
23.09.2015 / 04:07