MCChatModule 1.0.5

MCChatModule 1.0.5

Maintained by Marco Capano.



MCChatModule

A simple chat module to integrate with your app.

Swift Version License CocoaPods Compatible
Platform PRs Welcome

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

  1. Download and drop Sources in your project.
  2. 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😂) but you can still use it in your projects if you want. If you want more features and a supportive community, I would suggest using MessageKit

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.