-
-
Save VAndrJ/71e64549bc4ef1016ab000bf469b3ec0 to your computer and use it in GitHub Desktop.
iPhone X InputAccessoryView Fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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