回答編集履歴
1
プログラム変更
answer
CHANGED
@@ -216,4 +216,25 @@
|
|
216
216
|
}
|
217
217
|
}
|
218
218
|
}
|
219
|
-
```
|
219
|
+
```
|
220
|
+
---
|
221
|
+
追記
|
222
|
+
|
223
|
+
とある方からのコメントでちょっと変更を加えてみました。
|
224
|
+
```Swift
|
225
|
+
// 今回は、item の番号が奇数の時だけ左ボタンにアイテムを設定している
|
226
|
+
if item > 0 && item % 2 == 1 {
|
227
|
+
UIView.transition(with: leftButton, duration: 0.4, options: .transitionCrossDissolve) {
|
228
|
+
self.leftButton.setImage(UIImage(systemName: self.barItems[item] + ".circle")!, for: .normal)
|
229
|
+
} completion: { _ in
|
230
|
+
self.leftButton.tag = item
|
231
|
+
self.leftButton.isEnabled = true
|
232
|
+
|
233
|
+
}
|
234
|
+
} else if item == 0 {
|
235
|
+
leftButton.setImage(nil, for: .normal)
|
236
|
+
leftButton.isEnabled = false
|
237
|
+
}
|
238
|
+
```
|
239
|
+
|
240
|
+
該当する部分を変更すると、左側のボタンがクロスディゾルブで変わるようになります。
|