質問編集履歴
2
画像の黒丸のところで◉と○があるのですがこれは問題ないのでしょうか...?
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
### 前提・実現したいこと
|
1
|
+
![イメージ説明](0fb38a80df9cc9c0290225abe584e2db.png)### 前提・実現したいこと
|
2
2
|
|
3
3
|
|
4
4
|
|
1
AddTaskViewController.swift を追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -190,6 +190,66 @@
|
|
190
190
|
|
191
191
|
|
192
192
|
|
193
|
+
<<<AddTaskViewController>>>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
import UIKit
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
class AddTaskViewController: UIViewController {
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
@IBOutlet weak var textField: UITextField!
|
208
|
+
|
209
|
+
@IBOutlet weak var isImportant: UISwitch!
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
override func viewDidLoad() {
|
214
|
+
|
215
|
+
super.viewDidLoad()
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
// Do any additional setup after loading the view.
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
@IBAction func btnTapped(_ sender: Any) {
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
let task = Task(context: context)
|
234
|
+
|
235
|
+
task.name = textField.text!
|
236
|
+
|
237
|
+
task.isImportant = isImportant.isOn
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
(UIApplication.shared.delegate as! AppDelegate).saveContext()
|
242
|
+
|
243
|
+
navigationController!.popViewController(animated: true)
|
244
|
+
|
245
|
+
}
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
193
253
|
```
|
194
254
|
|
195
255
|
|