mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-02 06:06:57 +02:00
Revert presenter dismissal
This commit is contained in:
@@ -54,7 +54,6 @@ class FullscreenLoadingIndicatorPresenter: UserIndicatorPresentable {
|
||||
])
|
||||
|
||||
view.alpha = 0
|
||||
CATransaction.commit()
|
||||
UIView.animate(withDuration: 0.2) {
|
||||
view.alpha = 1
|
||||
}
|
||||
@@ -65,10 +64,16 @@ class FullscreenLoadingIndicatorPresenter: UserIndicatorPresentable {
|
||||
return
|
||||
}
|
||||
|
||||
UIView.animate(withDuration: 0.2, delay: 0, options: .beginFromCurrentState) {
|
||||
view.alpha = 0
|
||||
} completion: { _ in
|
||||
view.removeFromSuperview()
|
||||
// If `present` and `dismiss` are called right after each other without delay,
|
||||
// the view does not correctly pick up `currentState` of alpha. Dispatching onto
|
||||
// the main queue skips a few run loops, giving the system time to render
|
||||
// current state.
|
||||
DispatchQueue.main.async {
|
||||
UIView.animate(withDuration: 0.2, delay: 0, options: .beginFromCurrentState) {
|
||||
view.alpha = 0
|
||||
} completion: { _ in
|
||||
view.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user