Papercloud / KeyboardConstraint

A NSLayoutConstraint subclass which observes keyboard notifications.
MIT License
14 stars 2 forks source link

iPhone X compatibility #8

Closed markst closed 6 years ago

markst commented 6 years ago

Keyboard constraint needs to factor in the bottom layout guide length/height:

simulator screen shot - iphone x - 2017-10-10 at 14 50 46

markst commented 6 years ago

Not ideal. but something along these lines:

if (notification.name == UIKeyboardWillShowNotification && keyboardFrame.size.height > 0.0) {
    UIView * layoutGuide = self.firstItem;
    CGFloat keyboardHeight = CGRectGetHeight(keyboardFrame) - layoutGuide.frame.size.height;