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.
}
*/
}
'Swift > 기초&문법' 카테고리의 다른 글
MyWebBrowser swift 스위프트 웹브라우저 앱 (0) | 2018.11.07 |
---|---|
스위프트 화면 전환 present dismiss push pop segue modal swift (0) | 2018.11.06 |
꼼꼼한 재은씨의 스위프트 swift 실전편 api alamofire (0) | 2018.11.01 |
꼼꼼한 재은씨의 스위프트 swift 실전편 api 적용 앱 POST JSON (0) | 2018.10.31 |
꼼꼼한 재은씨의 스위프트 swift 기본편 영화목록 앱 api json (0) | 2018.10.30 |