Skip to content

Instantly share code, notes, and snippets.

@masakid
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save masakid/ca13c18b2e9d4866e60a to your computer and use it in GitHub Desktop.

Select an option

Save masakid/ca13c18b2e9d4866e60a to your computer and use it in GitHub Desktop.
lesson14
//課題14
//追加画面
import UIKit
class AddFormViewController: UIViewController {
//追加の名前
@IBOutlet weak var textFieldForName: UITextField!
var appDelegate:AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
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 saveNameForm(sender: AnyObject) {
//追加名を取得
let addName:String = self.textFieldForName.text
//共通データへ追加名を格納
appDelegate.common.setFruitsWithName(addName, isCheck: false)
//segueで遷移
performSegueWithIdentifier("saveSegue", sender: sender)
}
/*
// 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.
}
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment