Skip to content

Instantly share code, notes, and snippets.

@VAndrJ
Forked from ahbou/ComposeView.swift
Created March 3, 2018 09:10
Show Gist options
  • Save VAndrJ/71e64549bc4ef1016ab000bf469b3ec0 to your computer and use it in GitHub Desktop.
Save VAndrJ/71e64549bc4ef1016ab000bf469b3ec0 to your computer and use it in GitHub Desktop.
iPhone X InputAccessoryView Fix
//
// ComposeView.swift
import UIKit
class ComposeView: UIView {
// ........
// Other layout code and methods
// ........
//We're adding the bottom constraint here to make sure we belong to window
override func didMoveToWindow() {
super.didMoveToWindow()
if #available(iOS 11.0, *) {
if let window = window {
bottomAnchor.constraintLessThanOrEqualToSystemSpacingBelow(window.safeAreaLayoutGuide.bottomAnchor, multiplier: 1.0).isActive = true
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment