Commit fed27fa7 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

ui: support iphoneX

This patch ensures safe area margins for message field.

Change-Id: Ia99fe358e1f6a54a845d49b10682de815b967a1b
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 9bdc72da
......@@ -25,4 +25,16 @@ class MessageAccessoryView: UIView, NibLoadable {
@IBOutlet weak var messageTextField: UITextField!
override open func didMoveToWindow() {
super.didMoveToWindow()
if #available(iOS 11.0, *) {
guard let window = self.window else {
return
}
self.bottomAnchor
.constraintLessThanOrEqualToSystemSpacingBelow(window.safeAreaLayoutGuide.bottomAnchor,
multiplier: 1)
.isActive = true
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment