MengTo / Spring

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

Seems not to work with iPhone X models #326

Open ddownn opened 5 years ago

ddownn commented 5 years ago

I've had some trouble getting this to work consistently with Predictive Text on vs. off, and on all iPhone X models there is a significant gap between the top of the keyboard and the bottom of the constrained element, while the older iPhone models appear correctly.

vahids commented 5 years ago

temp fix: I used AssistantKit pod and edit this line 53 of KeyboardLayoutConstraint.swift to: keyboardVisibleHeight = frame.size.height - (Device.isNotched ? 34 : 0)

abilenko commented 5 years ago

Thank you for reply @vahids.

This is my solution: Edit this line 53 of KeyboardLoyoutConstraint.swift to:

let bottomSafeAreaInset = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0 keyboardVisibleHeight = frame.size.height - bottomSafeAreaInset