MessageInputManager is drop in copy of iMessage message input. MessageInputManager allows users to enter text message as well as media messages. It allows to capture photo directly from the place and allows to capture photo or select photo using UIImagePickerController.
- iOS 9.0+
- Xcode 9.4+ (Did not tested on older versions.)
- Swift 4.0+
To run the example project, clone the repo, and run pod install
from the Example directory first.
MessageInputManager is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MessageInputManager'
Use it as input accessory view to UIView
which handles chat details or where user input is required
To make UIView
first responder, Subclass UIView
and return true from canBecomeFirstResponder
.
Then Return MIMessageInputView
as input accessory view.
class ConversationDetailView: UIView {
// MARK: - Variables
let messageInputView:MIMessageInputView = MIMessageInputView()
// MARK: - Life cycle methods
override var canBecomeFirstResponder: Bool{
return true
}
override var inputAccessoryView: UIView?{
return messageInputView
}
}
UIViewController
can also become first responder and MIMessageInputView
can be returned as accessory view.
Set delegate to MIMessageInputView
where you want to receive call when user press send with all the details.
Akshay Kuchhadiya, [email protected]
MessageInputManager is available under the MIT license. See the LICENSE file for more info.