MengTo / Spring

A library to simplify iOS animations in Swift.
http://designcode.io
MIT License
14.08k stars 1.8k forks source link

KeyboardLayoutConstraint + UIAlertController animation are broken [iOS 11] #313

Open roma6125 opened 6 years ago

roma6125 commented 6 years ago

animation

roma6125 commented 6 years ago

Can be fixed by calling .layoutIfNeeded() on views from constraint items, instead of UIApplication.shared.keyWindow

func layoutViews() {
        for item in [firstItem, secondItem] {
            if let view = item as? UIView {
                view.layoutIfNeeded()
            }
            else if #available(iOS 9.0, *), let layoutGuide = item as? UILayoutGuide {
                layoutGuide.owningView?.layoutIfNeeded()
            }
        }
    }