modal 방식



navigation controller 추가한 push 방식






//

//  FirstViewController.swift

//  ai 11

//

//  Created by stayfoolish on 2018. 9. 19..

//  Copyright © 2018년 stayfoolish. All rights reserved.

//


import UIKit


class FirstViewController: UIViewController {


    override func viewDidLoad() {

        super.viewDidLoad()


        // Do any additional setup after loading the view.

    }


    override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()

        // Dispose of any resources that can be recreated.

    }

    

    @IBAction func buttonPressed(_ sender: UIButton) {

        self.performSegue(withIdentifier: "goToSecondViewController", sender: 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.destinationViewController.

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

    }

    */


}



//

//  SecondViewController.swift

//  ai 11

//

//  Created by stayfoolish on 2018. 9. 19..

//  Copyright © 2018년 stayfoolish. All rights reserved.

//


import UIKit


class SecondViewController: UIViewController {


    override func viewDidLoad() {

        super.viewDidLoad()


        // Do any additional setup after loading the view.

    }


    override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()

        // Dispose of any resources that can be recreated.

    }

    

    @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.destinationViewController.

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

    }

    */


}






+ Recent posts