Messagekit: Message Input Bar Flickering On New Line

Created on 1 Nov 2017  路  7Comments  路  Source: MessageKit/MessageKit

General Information

  • MessageKit Version: 0.1.0

  • iOS Version(s): 10.3.2

  • Swift Version: 4

  • Devices/Simulators: iPhone 6s Device & Simulator

  • Reproducible in ChatExample? (Yes/No): Yes

What happened?

When the message reaches end of line in input bar, the message goes to next line with a flicker, i.e the message input bar looks kind of closing and re-opening on every new line.

What did you expect to happen?

Can we remove this flickering when going to new line on message input bar? this kind of feels weird.

bug?

Most helpful comment

Hi @nathantannar4. I tested this further and I come to understand this issue is shown when IQKeyboardManager is enabled. The solution is to disable IQKeyboardManager in the ViewController with following code.

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
     IQKeyboardManager.sharedManager().enable = false
}

override func viewDidDisappear(_ animated: Bool) {
    super.viewDidDisappear(animated)
    IQKeyboardManager.sharedManager().enable = true
}

There are several users who uses IQKeyboardManager library. Perhaps if we can add a note in the documentation warning the user to disable IQKeyboardManager in the ViewController to avoid the conflict.

I will close this issue for now.

All 7 comments

@azhararmar Interesting, I am having trouble seeing this flickering. Even when I slow the simulators animation time

PFA the screenshot in GIF format. I tested this in iOS11 simulator and the issue exist for me.

screenshot

I am running the simulator with default settings.

Hi @azhararmar , I can't yet reproduce this in the ChatExample app. Are you using some kind of custom View controller container where your MessagesViewController is a child view controller? Have you overriden or changed any default values of the MessagesViewController

Hi @nathantannar4. I tested this further and I come to understand this issue is shown when IQKeyboardManager is enabled. The solution is to disable IQKeyboardManager in the ViewController with following code.

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
     IQKeyboardManager.sharedManager().enable = false
}

override func viewDidDisappear(_ animated: Bool) {
    super.viewDidDisappear(animated)
    IQKeyboardManager.sharedManager().enable = true
}

There are several users who uses IQKeyboardManager library. Perhaps if we can add a note in the documentation warning the user to disable IQKeyboardManager in the ViewController to avoid the conflict.

I will close this issue for now.

Hey @azhararmar thanks for updating us and documenting this for other users 馃憤

Ah yes @azhararmar we already manage the keyboard state.

Sent with GitHawk

Hi @nathantannar4 -
Even after removing IQKeyboardManager entirely from my project (I uninstalled the pod) my app still flickers (more like pauses) when it's preparing to go to a new line. What info can I give you to help get to the bottom of it? Thanks!

Was this page helpful?
0 / 5 - 0 ratings