Messagekit: Inputview flickering issue

Created on 4 Nov 2018  路  3Comments  路  Source: MessageKit/MessageKit

  • What version of MessageKit are you using?
    MessageKit (1.0.0)
  • What version of iOS are you running on?
    iOS 12.1
  • What version of Swift are you running on?
    Swift 4.0
  • What device(s) are you testing on? Are these simulators?
    iPhone 7 & Simulator 6s & 7
  • Is the issue you're experiencing reproducable in the example app?
    No

fickering issue link

Source code

private func prepareDelegates() {
        messagesCollectionView.messagesDataSource = self
        messagesCollectionView.messagesLayoutDelegate = self
        messagesCollectionView.messagesDisplayDelegate = self
        messagesCollectionView.messageCellDelegate = self
        messageInputBar.delegate = self
    }

    private func prepareInputField() {
        //
        messageInputBar.sendButton.tintColor = UIColor(red: 69/255, green: 193/255, blue: 89/255, alpha: 1)
        scrollsToBottomOnKeybordBeginsEditing = true // default false
        maintainPositionOnKeyboardFrameChanged = true // default false

        // Refresh
        messagesCollectionView.addSubview(refreshControl)
        refreshControl.addTarget(self, action: #selector(ChatViewController.observeMessages), for: .valueChanged)

        // Customisation
        defaultStyle()
    }

    func defaultStyle() {
        let newMessageInputBar = MessageInputBar()
        newMessageInputBar.sendButton.tintColor = UIColor(red: 69/255, green: 193/255, blue: 89/255, alpha: 1)
        newMessageInputBar.delegate = self
        messageInputBar = newMessageInputBar
        reloadInputViews()
    }

all these methods are called in viewdidload.

All 3 comments

Do you use IQKeyboardManager ?

^ I have seen this before and IQKeyboardManager can be a reason. If not, please try MessageKit 2.0

Yes, that's correct.
It's due to IQKeyboardManager.
Thanks, @nathantannar4 @c941010623 for quick help.

Was this page helpful?
0 / 5 - 0 ratings