Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jsqmessagesviewcontroller inputToolBar IOS 11 iphone X Swift4

I know that this library is already deprecated, but has anyone fixed the problem with the inputToolBar and iPhone X? Currently the inputToolBar is partially covered.Check out the attached image.

enter image description here

Thanks in advance

like image 426
Sami Ali Avatar asked Nov 26 '22 21:11

Sami Ali


1 Answers

In case you don't want to change the code in the pod and use are more swifty-like extension you can use the following code:

extension JSQMessagesInputToolbar {
    override open func didMoveToWindow() {
        super.didMoveToWindow()
        guard let window = window else { return }
        if #available(iOS 11.0, *) {
            let anchor = window.safeAreaLayoutGuide.bottomAnchor
            bottomAnchor.constraintLessThanOrEqualToSystemSpacingBelow(anchor, multiplier: 1.0).isActive = true
        }
    }
}
like image 149
J-Bossi Avatar answered Dec 10 '22 12:12

J-Bossi