Giter VIP home page Giter VIP logo

nochat's Introduction

Languages

NoChat

NoChat is a lightweight chat UI framework which has no particular faces. The projects in Examples directory show you how to use this framework to implement a text game with user interface like Telegram or WeChat very easily. You can custom your own with NoChat :].

  

Features

  • Inverted mode
  • Adaptive user interface
  • Custom chat items and input panel
  • Simple MVC pattern
  • Supports both Objective-C and Swift

Requirements

  • iOS 8.0+
  • Xcode 8.2.1 or above

Install

NoChat supports multiple methods for install.

CocoaPods

Include the following in your Podfile:

target 'TargetName' do
    pod 'NoChat', '~> 0.3'
end

Carthage

Include the following in your Cartfile:

github "little2s/NoChat" ~> 0.3

Manually

Download and drop /NoChat/NoChat folder in your project.

Architecture

Model

  • <NOCChatItem>

Views

  • NOCChatContainerView
  • NOCChatInputPanel
  • NOCChatCollectionView
  • NOCChatCollectionViewLayout
  • NOCChatItemCell
  • <NOCChatItemCellLayout>

ViewController

  • NOCChatViewController

Usage

Objective-C

Import the framework.

#import <NoChat/NoChat.h>

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

@interface TGChatViewController : NOCChatViewController
    // ...
@end

@implementation TGChatViewController

    // Overrides these three methods below to provide basic classes.
    + (Class)cellLayoutClassForItemType:(NSString *)type
    {
        // ...
    }

    + (Class)inputPanelClass
    {
        // ...
    }

    - (void)registerChatItemCells
    {
        // ...
    }
        
}

Implement your business in this subclass. You may update layouts property through these there methods provide by super class:

  • insertLayouts:atIndexes:animated:
  • deleteLayoutsAtIndexes:animated:
  • updateLayoutAtIndex:toLayout:animated:

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 NOCChatViewController. Source code is mind, not just code, I think.

Swift

Import the framework.

import NoChat

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

class TGChatViewController: NOCChatViewController {

    // Overrides these three methods below to provide basic classes.
    override class func cellLayoutClass(forItemType type: String) -> Swift.AnyClass? {
        // ...
    }
    
    override class func inputPanelClass() -> Swift.AnyClass? {
        // ...
    }
    
    override func registerChatItemCells() {
        // ...
    }
    
}

Implement your business in this subclass. The same way as description in Objective-C section above.

More

See the Examples projects inside.

About

  • This framework is inspired by Chatto and Telegram. Thanks.
  • All reources in example projects are extracted from real app Telegram and WeChat. Do not use these resources in your project for business directly.
  • The example use YYLabel instead of UILabel and HPGrowingTextView for writing text input panel. Thanks to these great contributers. And these dependencies are not essential for NoChat framework. NoChat is just a view layer framework which mainly provide a container just like UITableViewController.
  • Text game is migration from Here.
  • If you prefer the pure swift version before 0.3, here is a great fork by @mbalex99 with swift 3 support: https://github.com/mbalex99/NoChat, thanks for their great work.

License

Source code is distributed under MIT license.

nochat's People

Contributors

hahla avatar lfarah avatar little2s avatar

Watchers

 avatar  avatar

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.