I have a page view controller with three view controllers and the third one is my MessagesViewController one. The issue is my input text view isn't showing up for whatever reason I have tried countless things that have worked for some people and not for me, I have been looking for a solution for 3 full hours now. I realize this problem has already been addressed and I have been on every stack overflow and GitHub thread on this issue and nothings working. From what I can tell there is an issue with the hierarchy and some child view controller as well as first responders, but I can never get them set because all my functions like viewDidAppear or viewWillAppear aren't working correctly
Page View Controller
- VC1
-VC2
-VC3 (the one I'm working with)
- textfield not showing up
* MessageKit Version:
latest
iOS Version(s):
11.2.5
Swift Version:
4.0
Devices/Simulators:
iPhone 7 (Device)
Reproducible in ChatExample? (Yes/No):
No
The messageInputLabel is not working
https://github.com/MessageKit/MessageKit/blob/master/Documentation/FAQs.md
Call becomeFirstResponder() on the VC when the view appears
@nathantannar4 I have tried that already, any other suggestions?
You are probably not transitioning to views correctly. Is this some custom page view controller?
@nathantannar4 no it is not
I know this issue is closed, but sometimes there are other view controllers resigning your chat view controller. In order to prevent that, you should override the following property like so:
override var canResignFirstResponder: Bool {return false}
it might help anyone later on
@ahmedmukbil
I know this issue is closed, but sometimes there are other view controllers resigning your chat view controller. In order to prevent that, you should override the following property like so:
override var canResignFirstResponder: Bool {return false}
it might help anyone later on
question ..override var canResignFirstResponder: Bool {return false} it's not working for me .. Where i have to give code? .. In all ViewControllers or only one ViewController ?
let conversationViewController = BasicExampleViewController()
/// Required for the MessageInputBar to be visible
override var canBecomeFirstResponder: Bool {
return conversationViewController.canBecomeFirstResponder // must be true
}
/// Required for the MessageInputBar to be visible
override var inputAccessoryView: UIView? {
return conversationViewController.inputAccessoryView
}
Surprisingly, this issue only happens once I have started / stopped animating the send button, if that's any indication of where things might be going awry.
Most helpful comment
https://github.com/MessageKit/MessageKit/blob/master/Documentation/FAQs.md
Call
becomeFirstResponder()on the VC when the view appears