Skip to content

Commit

Permalink
Merge pull request #277 from danqing/master
Browse files Browse the repository at this point in the history
Don't do performLayout async after all
  • Loading branch information
Kaspik authored Oct 15, 2024
2 parents 215edf4 + 85fb7de commit c7acd5f
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit c7acd5f

Please sign in to comment.