꼼꼼한 재은씨의 스위프트 swift 기본편 화면전환
//
// ViewController.swift
// Scene-Trans02
//
// Created by stayfoolish on 27/10/2018.
// Copyright © 2018 stayfoolish. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func moveByNavi(_ sender: UIBarButtonItem) {
guard let uvc = self.storyboard?.instantiateViewController(withIdentifier: "SecondVC")else {
return
}
self.navigationController?.pushViewController(uvc, animated: true)
}
@IBAction func movePresent(_ sender: UIButton) {
guard let uvc = self.storyboard?.instantiateViewController(withIdentifier: "SecondVC") else {
return
}
self.present(uvc,animated: true)
}
}
//
// SecondViewController.swift
// Scene-Trans02
//
// Created by stayfoolish on 27/10/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.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func back(_ sender: UIButton) {
self.presentingViewController?.dismiss(animated: true)
}
@IBAction func Back2(_ sender: UIButton) {
self.navigationController?.popViewController(animated: true)
}
/*
// 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.
}
*/
}
'Swift > 기초&문법' 카테고리의 다른 글
꼼꼼한 재은씨의 스위프트 swift 실전편 api 적용 앱 POST JSON (0) | 2018.10.31 |
---|---|
꼼꼼한 재은씨의 스위프트 swift 기본편 영화목록 앱 api json (0) | 2018.10.30 |
do it 스위프트 아이폰 앱 만들기 19장 Picnch Gesture swift (0) | 2018.10.25 |
do it 스위프트 아이폰 앱 만들기 18장 swift swipe gestrue 스와이프 제스처 (0) | 2018.10.24 |
do it 스위프트 아이폰 앱 만들기 17장 swift touch tap sketch app 스케치 앱 (0) | 2018.10.23 |