Skip to content

zhuozhuo/ZHChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 20, 2017
2776b2a · Nov 20, 2017

History

99 Commits
Mar 27, 2017
May 25, 2017
Nov 20, 2017
Oct 9, 2017
Mar 27, 2017
Jun 21, 2017
Mar 27, 2017
Mar 27, 2017
Mar 27, 2017
Apr 7, 2017
Mar 27, 2017
Mar 27, 2017
Mar 27, 2017
Jun 27, 2017
Jun 27, 2017
Oct 9, 2017

Repository files navigation

ZHChat

ZHChat is a free open source chat UI components, support for sending voice, pictures, words, expressions, location, video messages. ZHChat can help developers to quickly integrate IM service, easy chat, provides totally free licensing agreement, support for secondary development. Welcome to pull Request.

![Gif][gif0]

Thanks Gargo translation.

Features

  • Interface to imitate Apple with a messaging application interface.
  • Contains text, pictures, voice, location, sends a video message features.
  • Excludes chat interface is based on a UITableView, easier to understand the entire UI framework。

Design Goals

Easy integrated chat feature.

Requirements

  • iOS 7.0+
  • ARC

Usage

CocoaPods (recommended)

pod 'ZHChat'

Copy the folder ZHCMessagesViewController to your project

Getting Started

Getting started guide for ZHChat

#import <ZHChat/ZHCMessages.h> // import all the things
  • ** Demo Project**

    • There's a sweet demo project: 'ZHChat.xcworkspace'
      • Run 'pod install' first
  • Customizing

    • The demo project is well-commented. Please use this as a guide.

    • View Controller

    • Subclass ZHCMessagesViewController.

    • Implement the required methods in the ZHCMessagesTableViewDataSource protocol.

    • Implement the required methods in the ZHCMessagesTableViewDelegate protocol.

    • Implement the required methods in the ZHCMessagesMoreViewDelegate protocol.

    • Implement the required methods in the ZHCMessagesMoreViewDataSource protocol.

    • Implement the required methods in the ZHCEmojiViewDelegate protocol.

    • Implement the required methods in the ZHCMessagesInputToolbarDelegate protocol.

    • Set your senderId and senderDisplayName. These properties correspond to the methods found in ZHCMessageData and determine which messages are incoming or outgoing.

  • Avatar Model

    • Your avatar model objects should conform to the ZHCMessageBubbleImageDataSource protocol.
    • However, you may use the provided ZHCMessagesAvatarImage class.
    • Also see ZHCMessagesAvatarImageFactory for easily generating custom avatars.
  • Message Bubble Model

    • Your message bubble model objects should conform to the ZHCMessageAvatarImageDataSource protocol.
    • However, you may use the provided ZHCMessagesAvatarImage class.
    • Also see ZHCMessagesBubbleImageFactory and UIImage+ZHCMessages for easily generating custom bubbles.
  • Message Model

    • Your message model objects should conform to the ZHCMessageData protocol.
    • However, you may use the provided ZHCMessage class.
  • Media Attachment Model

    • Your media attachment model objects should conform to the ZHCMessageMediaData protocol.
    • However, you may use the provided classes: ZHCAudioMediaItem, ZHCLocationMediaItem, ZHCPhotoMediaItem.
    • Creating your own custom media items is easy! Simply follow the pattern used by the built-in media types.
    • Also see ZHCMessagesMediaPlaceholderView for masking your custom media views as message bubbles.
  • More Module

    • You can see ZHCMessagesMoreView .
    • Implement the required methods in the ZHCMessagesMoreViewDelegate protocol.
    • Implement the required methods in the ZHCMessagesMoreViewDataSource protocol.
  • Audio Module

    • You can see ZHCMessagesVoiceRecorder,ZHCMessagesAudioProgressHUD .
    • ZHCMessagesAudioProgressHUD is a recording voice animation view.
    • ZHCMessagesVoiceRecorder is recorder. It implement the required methods in the ZHCMessagesVoiceDelegate protocol.
  • Emoji Module

    • You can see ZHCMessagesEmojiView .
    • Implement the required methods in the ZHCEmojiViewDelegate protocol.
    • The emoji resource in ZHCEmojiList.plist.

To Do

  • Increased adaptation work rotation and horizontal screen adaptation function。

Thanks

Thaks Jesse Squires Structures and resources drawn on JSQMessagesViewController.

License

This code is distributed under the terms and conditions of the MIT license.