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.
Thanks Gargo translation.
- 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。
Easy integrated chat feature.
- iOS 7.0+
- ARC
CocoaPods (recommended)
pod 'ZHChat'
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
- There's a sweet demo project: 'ZHChat.xcworkspace'
-
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
andsenderDisplayName
. These properties correspond to the methods found inZHCMessageData
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.
- Your avatar model objects should conform to the
-
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
andUIImage+ZHCMessages
for easily generating custom bubbles.
- Your message bubble model objects should conform to the
-
Message Model
- Your message model objects should conform to the
ZHCMessageData
protocol. - However, you may use the provided
ZHCMessage
class.
- Your message model objects should conform to the
-
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.
- Your media attachment model objects should conform to the
-
More Module
- You can see
ZHCMessagesMoreView
. - Implement the required methods in the
ZHCMessagesMoreViewDelegate
protocol. - Implement the required methods in the
ZHCMessagesMoreViewDataSource
protocol.
- You can see
-
Audio Module
- You can see
ZHCMessagesVoiceRecorder
,ZHCMessagesAudioProgressHUD
. ZHCMessagesAudioProgressHUD
is a recording voice animation view.ZHCMessagesVoiceRecorder
is recorder. It implement the required methods in theZHCMessagesVoiceDelegate
protocol.
- You can see
-
Emoji Module
- You can see
ZHCMessagesEmojiView
. - Implement the required methods in the
ZHCEmojiViewDelegate
protocol. - The emoji resource in
ZHCEmojiList.plist
.
- You can see
- Increased adaptation work rotation and horizontal screen adaptation function。
Thaks Jesse Squires Structures and resources drawn on JSQMessagesViewController.
This code is distributed under the terms and conditions of the MIT license.