Various fixes

This commit is contained in:
Ilya Laktyushin
2024-08-02 22:05:33 +02:00
parent 8e8b8b7a3e
commit 2ea60be3da
5 changed files with 62 additions and 39 deletions

View File

@@ -558,6 +558,15 @@ public class MinimizedContainerImpl: ASDisplayNode, MinimizedContainer, ASScroll
self.requestUpdate(transition: transition)
}
public func removeController(_ viewController: MinimizableController) {
guard let item = self.items.first(where: { $0.controller === viewController }) else {
return
}
self.items.removeAll(where: { $0.id == item.id })
self.requestUpdate(transition: .animated(duration: 0.25, curve: .easeInOut))
}
private enum Transition: Equatable {
case minimize(itemId: AnyHashable)
case maximize(itemId: AnyHashable)