Various fixes

This commit is contained in:
Ilya Laktyushin
2024-05-31 19:06:26 +04:00
parent 9ea80ff9dc
commit 8cd037bf74
5 changed files with 103 additions and 62 deletions

View File

@@ -268,16 +268,20 @@ public final class SearchDisplayController {
searchBar?.removeFromSupernode()
})
} else {
searchBar.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak searchBar] _ in
searchBar?.removeFromSupernode()
searchBar.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak searchBar] finished in
if finished {
searchBar?.removeFromSupernode()
}
})
}
let backgroundNode = self.backgroundNode
let contentNode = self.contentNode
if animated {
backgroundNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak backgroundNode] _ in
backgroundNode?.removeFromSupernode()
backgroundNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak backgroundNode] finished in
if finished {
backgroundNode?.removeFromSupernode()
}
})
} else {
backgroundNode.removeFromSupernode()