質問編集履歴
2
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,6 +23,10 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
```swift
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
// CustomCell内
|
26
30
|
|
27
31
|
|
28
32
|
|
@@ -74,4 +78,6 @@
|
|
74
78
|
|
75
79
|
}
|
76
80
|
|
81
|
+
}
|
82
|
+
|
77
|
-
|
83
|
+
```
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,3 +15,63 @@
|
|
15
15
|
ライトモード時
|
16
16
|
|
17
17
|
![イメージ説明](184b26a9bbfe713e300d5c71a14df49c.gif)
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
現状、自前で用意したものと、indexPathForSelectedRowを連動させていますが、枠を黒くするだけなので、できれば楽がしたい。
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
```swift
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
override func setEditing(_ editing: Bool, animated: Bool) {
|
30
|
+
|
31
|
+
super.setEditing(editing, animated: animated)
|
32
|
+
|
33
|
+
if editing { // 自前のチェックマーク用スペースを表示
|
34
|
+
|
35
|
+
UIView.animate(withDuration: 0.4, delay: 0.0, options: .curveEaseIn, animations: {
|
36
|
+
|
37
|
+
self.checkMarkWidthConstraint.constant = self.checkMarkHeightConstraint.constant
|
38
|
+
|
39
|
+
self.contentView.layoutIfNeeded()
|
40
|
+
|
41
|
+
}, completion: nil)
|
42
|
+
|
43
|
+
} else { // 自前のチェックマーク用スペースを非表示
|
44
|
+
|
45
|
+
UIView.animate(withDuration: 0.4, delay: 0.0, options: .curveEaseIn, animations: {
|
46
|
+
|
47
|
+
self.checkMarkWidthConstraint.constant = 0.0
|
48
|
+
|
49
|
+
self.contentView.layoutIfNeeded()
|
50
|
+
|
51
|
+
}, completion: nil)
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
override func setSelected(_ selected: Bool, animated: Bool) {
|
60
|
+
|
61
|
+
super.setSelected(selected, animated: animated)
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
if !isEditing { return }
|
66
|
+
|
67
|
+
if selected {
|
68
|
+
|
69
|
+
// チェックマーク画像を貼る
|
70
|
+
|
71
|
+
} else {
|
72
|
+
|
73
|
+
// 丸枠画像を貼る
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
}```
|