Hi, Thanks for the best library for messaging, but I am having the issue that when adding MessagesViewController into a containerView its not showing input bar.
I have tried adding view pragmatically and using story board also.
How to fix that, as I am using the latest version as per date. & using swift 5
Help would be appreciated.
public func add(asChildViewController viewController: UIViewController,to parentView:UIView) {
// Add Child View Controller
addChild(viewController)
// Add Child View as Subview
parentView.addSubview(viewController.view)
// Configure Child View
viewController.view.frame = parentView.bounds
viewController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
// Notify Child View Controller
viewController.didMove(toParent: self)
}
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let viewController = storyboard.instantiateViewController(withIdentifier: "chatVC") as! ChatViewController
self.add(asChildViewController: viewController, to: chatView)
this is How I am adding containerView, where ChatView is the ContainerView
You need to manually call becomeFirstResponder() on input bar.
Thank you It has been solved.
what I did after passing it to ContainerView , In the MessageViewControllerClass added these lines only and its working now.
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.becomeFirstResponder()
messageInputBar.becomeFirstResponder()
}
Thanks A-lot again.
Most helpful comment
You need to manually call becomeFirstResponder() on input bar.