Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't do performLayout async after all #277

Merged
merged 9 commits into from
Oct 15, 2024
14 changes: 7 additions & 7 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 {
if animated {
DispatchQueue.main.async {
UIView.animate(withDuration: 0.3, animations: animations)
} else {
UIView.performWithoutAnimation { animations() }
}

self.activateConstraints()
} else {
UIView.performWithoutAnimation { animations() }
}

self.activateConstraints()
}

/// Activates the NSLayoutConstraintSet's
Expand Down