|
LuxChat
2.0
Instant messenger for iOS
|
#import <JSQMessage.h>
Instance Methods | |
| (instancetype) | - initWithSenderId:senderDisplayName:date:text: |
| (instancetype) | - initWithSenderId:senderDisplayName:date:media: |
Class Methods | |
| (instancetype) | + messageWithSenderId:displayName:text: |
| (instancetype) | + messageWithSenderId:displayName:media: |
Properties | |
| NSString * | senderId |
| NSString * | senderDisplayName |
| NSDate * | date |
| BOOL | isMediaMessage |
| NSString * | text |
| id< JSQMessageMediaData > | media |
The JSQMessage class is a concrete class for message model objects that represents a single user message. The message can be a text message or media message, depending on how it is initialized. It implements the JSQMessageData protocol and it contains the senderId, senderDisplayName, and the date that the message was sent. If initialized as a media message it also contains a media attachment, otherwise it contains the message text.
| - (instancetype) initWithSenderId: | (NSString *) | senderId | |
| senderDisplayName: | (NSString *) | senderDisplayName | |
| date: | (NSDate *) | date | |
| media: | (id<JSQMessageMediaData>) | media | |
Initializes and returns a message object having the given senderId, displayName, date, and media.
| senderId | The unique identifier for the user who sent the message. This value must not be nil. |
| senderDisplayName | The display name for the user who sent the message. This value must not be nil. |
| date | The date that the message was sent. This value must not be nil. |
| media | The media data for the message. This value must not be nil. |
Initializing a JSQMessage with this method will set isMediaMessage to YES.
JSQMessage object if successful, nil otherwise. | - (instancetype) initWithSenderId: | (NSString *) | senderId | |
| senderDisplayName: | (NSString *) | senderDisplayName | |
| date: | (NSDate *) | date | |
| text: | (NSString *) | text | |
Initializes and returns a message object having the given senderId, senderDisplayName, date, and text.
| senderId | The unique identifier for the user who sent the message. This value must not be nil. |
| senderDisplayName | The display name for the user who sent the message. This value must not be nil. |
| date | The date that the message was sent. This value must not be nil. |
| text | The body text of the message. This value must not be nil. |
Initializing a JSQMessage with this method will set isMediaMessage to NO.
JSQMessage object if successful, nil otherwise. | + (instancetype) messageWithSenderId: | (NSString *) | senderId | |
| displayName: | (NSString *) | displayName | |
| media: | (id<JSQMessageMediaData>) | media | |
Initializes and returns a message object having the given senderId, displayName, media, and current system date.
| senderId | The unique identifier for the user who sent the message. This value must not be nil. |
| displayName | The display name for the user who sent the message. This value must not be nil. |
| media | The media data for the message. This value must not be nil. |
Initializing a JSQMessage with this method will set isMediaMessage to YES.
JSQMessage object if successful, nil otherwise. | + (instancetype) messageWithSenderId: | (NSString *) | senderId | |
| displayName: | (NSString *) | displayName | |
| text: | (NSString *) | text | |
Initializes and returns a message object having the given senderId, displayName, text, and current system date.
| senderId | The unique identifier for the user who sent the message. This value must not be nil. |
| displayName | The display name for the user who sent the message. This value must not be nil. |
| text | The body text of the message. This value must not be nil. |
Initializing a JSQMessage with this method will set isMediaMessage to NO.
JSQMessage object if successful, nil otherwise.
|
readnonatomiccopy |
Returns the date that the message was sent.
|
readnonatomicassign |
Returns a boolean value specifying whether or not the message contains media. If NO, the message contains text. If YES, the message contains media. The value of this property depends on how the object was initialized.
|
readnonatomiccopy |
Returns the media item attachment of the message, or nil if the message is not a media message. That is, if isMediaMessage is equal to NO then this value will be nil.
|
readnonatomiccopy |
Returns the display name for the user who sent the message. This value does not have to be unique.
|
readnonatomiccopy |
Returns the string identifier that uniquely identifies the user who sent the message.
|
readnonatomiccopy |
Returns the body text of the message, or nil if the message is a media message. That is, if isMediaMessage is equal to YES then this value will be nil.
1.8.9.1