//
// ViewController.swift
// Storyboard
//
// Created by Apple7 on 2015. 10. 28..
//
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var scene1Label: UILabel!
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.
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let destination = segue.destinationViewController as! Scene2ViewController
destination.labelText = "화면 1에서 옴"
}
@IBAction func returned(segue: UIStoryboardSegue) {
scene1Label.text = "화면 2에서 돌아옴"
}
}
//
// Scene2ViewController.swift
// Storyboard
//
// Created by Apple7 on 2015. 10. 28..
//
//
import UIKit
class Scene2ViewController: UIViewController {
@IBOutlet weak var scene2Label: UILabel!
var labelText: String?
override func viewDidLoad() {
super.viewDidLoad()
scene2Label.text = labelText
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}