Last active
July 12, 2019 03:30
-
-
Save ahbou/d18a7450375f33c595802250117b2dde 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