Last active
August 29, 2015 14:21
-
-
Save masakid/ca13c18b2e9d4866e60a to your computer and use it in GitHub Desktop.
lesson14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //課題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