-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddToDoItem.swift
59 lines (40 loc) · 1.47 KB
/
AddToDoItem.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// AddToDoItem.swift
// ToDoList
//
// Created by Jain, Vaibhav on 9/12/14.
// Copyright (c) 2014 Jain, Vaibhav. All rights reserved.
//
import UIKit
class AddToDoItem: UIViewController {
@IBOutlet weak var doneButton: UIBarButtonItem!
@IBOutlet weak var textField: UITextField!
var newToDoItem: ToDoItem?
override func viewDidLoad() {
super.viewDidLoad()
println("TODO view is loaded now.")
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
if (sender as? UIBarButtonItem != self.doneButton){
return
}
if(!self.textField.text.isEmpty){
self.newToDoItem = ToDoItem(name: self.textField.text)
self.newToDoItem?.isDone = false
//self.newToDoItem.creationDate = NSDate()
}
}
/*
// 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.
}
*/
}