Skip to content

Commit

Permalink
Update InputBarAccessoryView.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
danqing committed Oct 15, 2024
1 parent f02046e commit ff19f34
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Sources/InputBarAccessoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -654,17 +654,17 @@ open class InputBarAccessoryView: UIView {
/// - animated: If the layout should be animated
/// - animations: Animation logic
internal func performLayout(_ animated: Bool, _ animations: @escaping () -> Void) {
DispatchQueue.main.async {
self.deactivateConstraints()
self.deactivateConstraints()

if animated {
DispatchQueue.main.async {
UIView.animate(withDuration: 0.3, animations: animations)
}
} else {
UIView.performWithoutAnimation { animations() }
if animated {
DispatchQueue.main.async {
UIView.animate(withDuration: 0.3, animations: animations)
}
} else {
UIView.performWithoutAnimation { animations() }
}

DispatchQueue.main.async {
self.activateConstraints()
}
}
Expand Down

0 comments on commit ff19f34

Please sign in to comment.