I want to give an alpha effect when closing the button's visibility with the code below. However, in the code below, the alpha effect works correctly, but instantly becomes , without waiting for 0.5 seconds of visibility.
Do you have alternative suggestions to solve this? Especially if you have a solution with RxSwift, RxCoca, it would be nice. Thanks.
self.button.alpha = 1.0
UIView.animate(withDuration: 0.5) {
self.button.alpha = 0
self.button.isHidden = true
}