-
Notifications
You must be signed in to change notification settings - Fork 1
/
CompleteTaskViewController.swift
executable file
·62 lines (48 loc) · 1.83 KB
/
CompleteTaskViewController.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
60
61
62
//
// CompleteTaskViewController.swift
// finalApp1
//
// Created by Apple on 7/17/19.
// Copyright © 2019 Apple. All rights reserved.
//
import UIKit
class CompleteTaskViewController: UIViewController {
var previousVC = TasksTableTableViewController()
var selectedTask : TaskCD?
// var selectedToDo : ToDoCD?
@IBOutlet weak var titleLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
titleLabel.text = selectedTask?.name
}
@IBAction func completeTapped(_ sender: Any) {
if let context = (UIApplication.shared.delegate as? AppDelegate)?.persistentContainer.viewContext {
if let theTask = selectedTask {
context.delete(theTask)
navigationController?.popViewController(animated: true)
}
// @IBAction func completeTapped(_ sender: Any) {
// if let context = (UIApplication.shared.delegate as? AppDelegate)?.persistentContainer.viewContext {
// if let theTask = selectedTask {
// context.delete(theTask)
// navigationController?.popViewController(animated: true)
// }
}
}
// completeTapped(_ sender: Any) {
// if let context = (UIApplication.shared.delegate as? AppDelegate)?.persistentContainer.viewContext {
// if let theToDo = selectedToDo {
// context.delete(theToDo)
// navigationController?.popViewController(animated: true)
// }
// }
// }
// @IBAction func completeTapped(_ sender: Any) {
// if let context = (UIApplication.shared.delegate as? AppDelegate)?.persistentContainer.viewContext {
// if let theToDo = selectedToDo {
// context.delete(theToDo)
// navigationController?.popViewController(animated: true)
// }
// }
// }
}