質問編集履歴

2

誤字

2019/10/16 03:33

投稿

tttttttnaga
tttttttnaga

スコア7

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
- estimate = aDecoder.decodeInteger(forKey: "time1")
93
+ time1 = aDecoder.decodeInteger(forKey: "time1")
94
-
94
+
95
- actual = aDecoder.decodeInteger(forKey: "time2")
95
+ time2 = aDecoder.decodeInteger(forKey: "time2")
96
96
 
97
97
  date = aDecoder.decodeObject(forKey: "date") as! Date
98
98
 

1

変数の更新

2019/10/16 03:33

投稿

tttttttnaga
tttttttnaga

スコア7

test CHANGED
File without changes
test CHANGED
@@ -26,9 +26,9 @@
26
26
 
27
27
  1.todo : String
28
28
 
29
- 2.estimate : Int
29
+ 2.time1 : Int
30
-
30
+
31
- 3.actual : Int
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 estimate: Int
53
+ let time1: Int
54
-
54
+
55
- let actual: Int
55
+ let time2: Int
56
56
 
57
57
  let date: Date
58
58
 
59
59
 
60
60
 
61
- init(todo:String, estimate:Int, actual:Int, date:Date) {
61
+ init(todo:String, time1:Int, time2:Int, date:Date) {
62
62
 
63
63
  self.todo = todo
64
64
 
65
- self.estimate = estimate
65
+ self.time1 = time1
66
-
66
+
67
- self.actual = actual
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: "estimate")
79
+ aCoder.encode(self.estimate, forKey: "time1")
80
-
80
+
81
- aCoder.encode(self.actual, forKey: "actual")
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: "estimate")
93
+ estimate = aDecoder.decodeInteger(forKey: "time1")
94
-
94
+
95
- actual = aDecoder.decodeInteger(forKey: "actual")
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 estimateInt:Int = Int()
143
+ var time1Int:Int = Int()
144
-
144
+
145
- var auctualInt:Int = Int()
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: estimateTime.text!)
151
+ let index = timePickerOption.firstIndex(of: timeLabel.text!)
152
-
152
+
153
- estimateInt = convertedTimePickerOption[index!]
153
+ time1Int = convertedTimePickerOption[index!]
154
-
154
+
155
- actualInt = estimateInt - count
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, estimate: estimateInt, actual: actualInt, date: f.date(from: s)!)]
177
+ content = [Content(todo: todoString, time1: time1Int, time2: time2Int, date: f.date(from: s)!)]
178
178
 
179
179
  contents.append(content)
180
180