-
Notifications
You must be signed in to change notification settings - Fork 0
/
TaskDetailViewController.swift
52 lines (33 loc) · 1.32 KB
/
TaskDetailViewController.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
//
// TaskDetailViewController.swift
// TaskIt2
//
// Created by Yakov on 20/10/15.
// Copyright © 2015 Bitfoundation. All rights reserved.
//
import UIKit
class TaskDetailViewController: UIViewController {
var detailTaskModel: TaskModel!
var mainVC: ViewController!
// @IBOutlet weak var subtaskTextField: UITextField!
@IBOutlet weak var taskTexField: UITextField!
@IBOutlet weak var dueDatePicker: UIDatePicker!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.taskTexField.text = detailTaskModel.task
self.dueDatePicker.date = detailTaskModel.date
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func cancelButtonTapped(sender: UIBarButtonItem) {
self.navigationController?.popToRootViewControllerAnimated(true)
}
@IBAction func doneBarButtonItemTapped(sender: UIBarButtonItem) {
var task = TaskModel(task: taskTexField.text!, date: dueDatePicker.date)
mainVC.taskArray[(mainVC.currentIndexPath.row)] = task
self.navigationController?.popToRootViewControllerAnimated(true)
}
}