Animation and other improvements

This commit is contained in:
Ali
2022-05-27 18:45:05 +04:00
parent 0d38a9bd08
commit bacd88a1ff
37 changed files with 498 additions and 426 deletions

View File

@@ -834,8 +834,12 @@ public final class ReactionNodePool {
private var views: [ReactionButtonAsyncNode] = []
func putBack(view: ReactionButtonAsyncNode) {
view.reset()
self.views.append(view)
assert(view.superview == nil)
if self.views.count < 64 {
view.reset()
self.views.append(view)
}
}
func take() -> Item {
@@ -892,6 +896,12 @@ public final class ReactionButtonsAsyncLayoutContainer {
public init() {
}
deinit {
for (_, button) in self.buttons {
button.view.removeFromSuperview()
}
}
public func update(
context: AccountContext,
action: @escaping (String) -> Void,