質問編集履歴
2
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
```swift
|
4
4
|
|
5
|
-
enum Status
|
5
|
+
enum Status {
|
6
6
|
case A
|
7
7
|
case B
|
8
8
|
case C
|
9
9
|
}
|
10
10
|
|
11
|
-
var statsu: Status = .A
|
11
|
+
var statsu: Status? = .A
|
12
12
|
|
13
13
|
func segmentedControlDidTap(_ sender: UISegmentedControl) {
|
14
14
|
status = Status(rawValue: sender.selectedSegmentIndex)
|
1
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
```swift
|
4
4
|
|
5
|
-
enum Status {
|
5
|
+
enum Status: Int {
|
6
6
|
case A
|
7
7
|
case B
|
8
8
|
case C
|
@@ -11,7 +11,7 @@
|
|
11
11
|
var statsu: Status = .A
|
12
12
|
|
13
13
|
func segmentedControlDidTap(_ sender: UISegmentedControl) {
|
14
|
-
status = sender.selectedSegmentIndex
|
14
|
+
status = Status(rawValue: sender.selectedSegmentIndex)
|
15
15
|
}
|
16
16
|
|
17
17
|
|