swift 스위프트 간단한 화면 전환 segue modaly






//

//  FirstViewController.swift

//  changeScreenTwo

//

//  Created by stayfoolish on 06/11/2018.

//  Copyright © 2018 stayfoolish. All rights reserved.

//


import UIKit


class FirstViewController: UIViewController {


    override func viewDidLoad() {

        super.viewDidLoad()


        // Do any additional setup after loading the view.

    }

    


    /*

    // MARK: - Navigation


    // In a storyboard-based application, you will often want to do a little preparation before navigation

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

        // Get the new view controller using segue.destination.

        // Pass the selected object to the new view controller.

    }

    */

    @IBAction func buttonPressed(_ sender: UIButton) {

        self.performSegue(withIdentifier: "goToSecondViewController", sender: nil)

    }

    

}




//

//  SecondViewController.swift

//  changeScreenTwo

//

//  Created by stayfoolish on 06/11/2018.

//  Copyright © 2018 stayfoolish. All rights reserved.

//


import UIKit


class SecondViewController: UIViewController {


    override func viewDidLoad() {

        super.viewDidLoad()


        // Do any additional setup after loading the view.

    }

    


    @IBAction func goBack(_ sender: UIButton) {

        self.dismiss(animated: true, completion: nil)

    }

    /*

    // MARK: - Navigation


    // In a storyboard-based application, you will often want to do a little preparation before navigation

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

        // Get the new view controller using segue.destination.

        // Pass the selected object to the new view controller.

    }

    */


}


+ Recent posts