Fix animation

This commit is contained in:
Ali 2022-08-30 21:21:00 +04:00
parent 2af9c675a7
commit 79a7f064c5

View File

@ -234,6 +234,7 @@ public final class EmojiStatusSelectionController: ViewController {
private var hapticFeedback: HapticFeedback?
private var isAnimatingOut: Bool = false
private var isDismissed: Bool = false
init(controller: EmojiStatusSelectionController, context: AccountContext, sourceView: UIView?, emojiContent: Signal<EmojiPagerContentComponent, NoError>) {
@ -373,6 +374,11 @@ public final class EmojiStatusSelectionController: ViewController {
}
func animateOut(completion: @escaping () -> Void) {
if self.isAnimatingOut {
return
}
self.isAnimatingOut = true
self.componentShadowLayer.animateAlpha(from: 1.0, to: 0.0, duration: 0.25, removeOnCompletion: false)
self.componentHost.view?.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.25, removeOnCompletion: false, completion: { _ in
completion()