Getting started guide for JSQMessagesViewController
#import <JSQMessagesViewController/JSQMessages.h> // import all the things
-
Tutorials and blogs
- Read the blog post about the 6.0 release!
- Ray Wenderlich has a great tutorial, written by David East. (For 7.x releases)
-
Demo Project
- There's a sweet demo project:
JSQMessages.xcworkspace
.- Run
pod install
first.
- Run
- Swift Example can be found in the SwiftExample folder just open the
SwiftExample.xcworkspace
.- Run
pod install
first.
- Run
- Firebase also has a sweet demo project, and it's in Swift!
- There's a sweet demo project:
-
Message Model
- Your message model objects should conform to the
JSQMessageData
protocol. - However, you may use the provided
JSQMessage
class.
- Your message model objects should conform to the
-
Media Attachment Model
- Your media attachment model objects should conform to the
JSQMessageMediaData
protocol. - However, you may use the provided classes:
JSQPhotoMediaItem
,JSQLocationMediaItem
,JSQVideoMediaItem
. - Creating your own custom media items is easy! Simply follow the pattern used by the built-in media types.
- Also see
JSQMessagesMediaViewBubbleImageMasker
for masking your custom media views as message bubbles.
- Your media attachment model objects should conform to the
-
Avatar Model
- Your avatar model objects should conform to the
JSQMessageAvatarImageDataSource
protocol. - However, you may use the provided
JSQMessagesAvatarImage
class. - Also see
JSQMessagesAvatarImageFactory
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
JSQMessageBubbleImageDataSource
protocol. - However, you may use the provided
JSQMessagesBubbleImage
class. - Also see
JSQMessagesBubbleImageFactory
andUIImage+JSQMessages.h
for easily generating custom bubbles.
- Your message bubble model objects should conform to the
-
View Controller
- Subclass
JSQMessagesViewController
. - Implement the required methods in the
JSQMessagesCollectionViewDataSource
protocol. - Implement the required methods in the
JSQMessagesCollectionViewDelegateFlowLayout
protocol. - Set your
senderId
andsenderDisplayName
. These properties correspond to the methods found inJSQMessageData
and determine which messages are incoming or outgoing.
- Subclass
-
Customizing
- The demo project is well-commented. Please use this as a guide.
Sorry! Guides are not available for older versions of the library.