質問編集履歴
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -90,9 +90,9 @@
|
|
90
90
|
|
91
91
|
todo = aDecoder.decodeObject(forKey: "todo") as! String
|
92
92
|
|
93
|
-
|
93
|
+
time1 = aDecoder.decodeInteger(forKey: "time1")
|
94
|
-
|
94
|
+
|
95
|
-
|
95
|
+
time2 = aDecoder.decodeInteger(forKey: "time2")
|
96
96
|
|
97
97
|
date = aDecoder.decodeObject(forKey: "date") as! Date
|
98
98
|
|
1
変数の更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,9 +26,9 @@
|
|
26
26
|
|
27
27
|
1.todo : String
|
28
28
|
|
29
|
-
2.
|
29
|
+
2.time1 : Int
|
30
|
-
|
30
|
+
|
31
|
-
3.
|
31
|
+
3.time2 : Int
|
32
32
|
|
33
33
|
4.date : Date
|
34
34
|
|
@@ -50,21 +50,21 @@
|
|
50
50
|
|
51
51
|
let todo: String
|
52
52
|
|
53
|
-
let
|
53
|
+
let time1: Int
|
54
|
-
|
54
|
+
|
55
|
-
let
|
55
|
+
let time2: Int
|
56
56
|
|
57
57
|
let date: Date
|
58
58
|
|
59
59
|
|
60
60
|
|
61
|
-
init(todo:String,
|
61
|
+
init(todo:String, time1:Int, time2:Int, date:Date) {
|
62
62
|
|
63
63
|
self.todo = todo
|
64
64
|
|
65
|
-
self.
|
65
|
+
self.time1 = time1
|
66
|
-
|
66
|
+
|
67
|
-
self.
|
67
|
+
self.time2 = time2
|
68
68
|
|
69
69
|
self.date = date
|
70
70
|
|
@@ -76,9 +76,9 @@
|
|
76
76
|
|
77
77
|
aCoder.encode(self.todo, forKey: "todo")
|
78
78
|
|
79
|
-
aCoder.encode(self.estimate, forKey: "
|
79
|
+
aCoder.encode(self.estimate, forKey: "time1")
|
80
|
-
|
80
|
+
|
81
|
-
aCoder.encode(self.actual, forKey: "
|
81
|
+
aCoder.encode(self.actual, forKey: "time2")
|
82
82
|
|
83
83
|
aCoder.encode(self.date, forKey: "date")
|
84
84
|
|
@@ -90,9 +90,9 @@
|
|
90
90
|
|
91
91
|
todo = aDecoder.decodeObject(forKey: "todo") as! String
|
92
92
|
|
93
|
-
estimate = aDecoder.decodeInteger(forKey: "
|
93
|
+
estimate = aDecoder.decodeInteger(forKey: "time1")
|
94
|
-
|
94
|
+
|
95
|
-
actual = aDecoder.decodeInteger(forKey: "
|
95
|
+
actual = aDecoder.decodeInteger(forKey: "time2")
|
96
96
|
|
97
97
|
date = aDecoder.decodeObject(forKey: "date") as! Date
|
98
98
|
|
@@ -140,19 +140,19 @@
|
|
140
140
|
|
141
141
|
let todoString:String = todo.text!
|
142
142
|
|
143
|
-
var
|
143
|
+
var time1Int:Int = Int()
|
144
|
-
|
144
|
+
|
145
|
-
var
|
145
|
+
var time2Int:Int = Int()
|
146
146
|
|
147
147
|
let now:Date = Date()
|
148
148
|
|
149
149
|
|
150
150
|
|
151
|
-
let index = timePickerOption.firstIndex(of:
|
151
|
+
let index = timePickerOption.firstIndex(of: timeLabel.text!)
|
152
|
-
|
152
|
+
|
153
|
-
|
153
|
+
time1Int = convertedTimePickerOption[index!]
|
154
|
-
|
154
|
+
|
155
|
-
|
155
|
+
time2Int = time1Int - count
|
156
156
|
|
157
157
|
|
158
158
|
|
@@ -174,7 +174,7 @@
|
|
174
174
|
|
175
175
|
// contentに書き込み、contentsにappend
|
176
176
|
|
177
|
-
content = [Content(todo: todoString,
|
177
|
+
content = [Content(todo: todoString, time1: time1Int, time2: time2Int, date: f.date(from: s)!)]
|
178
178
|
|
179
179
|
contents.append(content)
|
180
180
|
|