Giter VIP home page Giter VIP logo

nochat's Introduction

NoChat

NoChat is a Swift lightweight chat framework base on Chatto.
Along with NoChat, there are three companion frameworks: NoChatTG, NoChatMM, NoChatSLK.
These companion frameworks are just different user interface, you can custom your own with NoChat :].

  

  

Features

  • Calculation of collection view changes and layout in background
  • Supports pagination in both directions and autoloading
  • Message count contention for fast pagination and rotation with thousands of messsages
  • Supports custom message bubble and toolbar
  • Invert mode

Requirements

  • iOS 8.0+
  • Xcode 7.3 or above

Install

CocoaPods

Include the following in your Podfile:

pod 'NoChat'

Usage

Import the framework you want to use

import NoChat

You can create a subclass of ChatViewController, and provide the data.

class TGChatViewController: ChatViewController {

    // ...
    
    override func viewDidLoad() {
        inverted = true
        super.viewDidLoad()
    }

    
    // Setup chat items
    override func createPresenterBuilders() -> [ChatItemType: [ChatItemPresenterBuilderProtocol]] {
        return [
            DateItem.itemType : [
                DateItemPresenterBuider()
            ],
            MessageType.Text.rawValue : [
                MessagePresenterBuilder<TextBubbleView, TGTextMessageViewModelBuilder>(
                    viewModelBuilder: TGTextMessageViewModelBuilder(),
                    layoutCache: messageLayoutCache
                )
            ]
        ]
    }
    
    // Setup chat input views
    override func createChatInputViewController() -> UIViewController {
        let inputController = NoChatTG.ChatInputViewController()

        // ...
        
        return inputController
    }

    // ...
    
}

And I also suggest you custom the view controller of chat with the protocols provide by NoChat. I mean you can write your own ChatViewController without NoChat.ChatViewController. Source code is mind, not just code, I think.

Architechture

The architechture of the chat UI looks like this: Mind

More

See the Demo project inside.

About the name

Why call it NoChat? Because the boss let us write many apps with chat UI, sorry I really don't want to write chat UI anymore 😢

License

Source code is distributed under MIT license.

nochat's People

Contributors

little2s avatar

Watchers

James Cloos avatar Noah Tran avatar  avatar

Forkers

yaole

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.