diff --git a/Sources/InputBarAccessoryView.swift b/Sources/InputBarAccessoryView.swift index a1741040..ada0d077 100755 --- a/Sources/InputBarAccessoryView.swift +++ b/Sources/InputBarAccessoryView.swift @@ -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