MCChatModule
A simple chat module to integrate with your app.
Features
- Customizable
- Supports both landscape and portrait
Requirements
- iOS 11.0+
- Xcode 9.3
Installation
CocoaPods
You can use CocoaPods to install MCChatModule
by adding it to your Podfile
:
platform :ios, '11.0'
use_frameworks!
pod 'MCChatModule'
To get the full benefits import MCChatModule
wherever you import UIKit
import UIKit
import MCChatModule
Manually
- Download and drop
Sources
in your project. - Congratulations!
Use
Creating a chat screen is as simple as:
class ExampleChatViewController: MessagesCollectionViewController, MessagesCollectionViewControllerDataSource {
///The messages to display
var messages = [MessageType]() {
didSet {
collectionView?.reloadData()
}
}
override func viewDidLoad() {
datasource = self
}
func message(for indexPath: IndexPath) -> MessageType {
return messages[indexPath.item]
}
func numberOfMessages() -> Int {
return messages.count
}
}
and setting the controller delegate
property to customize the style.
Contribute
Pull requests and issues are welcome.
Notes
This project is intended as an exercise for both the chat module and pod creation (dealing with podspec is harder than coding
Please do not expect continuous support.
Creator: Marco Capano – @YourTwitter – [email protected]
Thanks to @SD10 for helping with podspec.
Distributed under the MIT license. See LICENSE
for more information.