#import <JSQMessagesViewController.h>
The JSQMessagesViewController class is an abstract class that represents a view controller whose content consists of a JSQMessagesCollectionView and JSQMessagesInputToolbar and is specialized to display a messaging interface.
- Warning
- This class is intended to be subclassed. You should not use it directly.
| - (void) didPressAccessoryButton: |
|
(UIButton *) |
sender |
|
This method is called when the user taps the accessory button on the inputToolbar.
- Parameters
-
| sender | The accessory button that was pressed by the user. |
| - (void) didPressSendButton: |
|
(UIButton *) |
button |
| withMessageText: |
|
(NSString *) |
text |
| senderId: |
|
(NSString *) |
senderId |
| senderDisplayName: |
|
(NSString *) |
senderDisplayName |
| date: |
|
(NSDate *) |
date |
|
|
| |
This method is called when the user taps the send button on the inputToolbar after composing a message with the specified data.
- Parameters
-
| button | The send button that was pressed by the user. |
| text | The message text. |
| senderId | The message sender identifier. |
| senderDisplayName | The message sender display name. |
| date | The message date. |
| - (void) finishReceivingMessage |
|
|
|
| - (void) finishReceivingMessageAnimated: |
|
(BOOL) |
animated |
|
Completes the "receiving" of a new message by showing the typing indicator, adding a new collection view cell in the collection view, reloading the collection view, and scrolling to the newly sent message as specified by automaticallyScrollsToMostRecentMessage. Scrolling to the new message can be animated as specified by the animated parameter.
- Parameters
-
| animated | Specifies whether the receiving of a message should be animated or not. Pass YES to animate changes, NO otherwise. |
You should call this method after adding a new "received" message to your data source and performing any related tasks.
- See also
automaticallyScrollsToMostRecentMessage.
| - (void) finishSendingMessage |
|
|
|
| - (void) finishSendingMessageAnimated: |
|
(BOOL) |
animated |
|
Completes the "sending" of a new message by resetting the inputToolbar, adding a new collection view cell in the collection view, reloading the collection view, and scrolling to the newly sent message as specified by automaticallyScrollsToMostRecentMessage. Scrolling to the new message can be animated as specified by the animated parameter.
- Parameters
-
| animated | Specifies whether the sending of a message should be animated or not. Pass YES to animate changes, NO otherwise. |
You should call this method at the end of didPressSendButton: withMessageText: senderId: senderDisplayName: date after adding the new message to your data source and performing any related tasks.
- See also
automaticallyScrollsToMostRecentMessage.
| + (instancetype) messagesViewController |
|
|
|
Returns the UINib object initialized for a JSQMessagesViewController.
- Returns
- The initialized
UINib object or nil if there were errors during initialization or the nib file could not be located.
You may override this method to provide a customized nib. If you do, you should also override messagesViewController to return your view controller loaded from your custom nib.
| - (void) scrollToBottomAnimated: |
|
(BOOL) |
animated |
|
Scrolls the collection view such that the bottom most cell is completely visible, above the inputToolbar.
- Parameters
-
| animated | Pass YES if you want to animate scrolling, NO if it should be immediate. |
| - (BOOL) automaticallyScrollsToMostRecentMessage |
|
readwritenonatomicassign |
Specifies whether or not the view controller should automatically scroll to the most recent message when the view appears and when sending, receiving, and composing a new message.
The default value is YES, which allows the view controller to scroll automatically to the most recent message. Set to NO if you want to manage scrolling yourself.
Returns the collection view object managed by this view controller. This view controller is the collection view's data source and delegate.
| - (NSString*) incomingCellIdentifier |
|
readwritenonatomiccopy |
The collection view cell identifier to use for dequeuing incoming message collection view cells in the collectionView for text messages.
This cell identifier is used for incoming text message data items. The default value is the string returned by [JSQMessagesCollectionViewCellIncoming cellReuseIdentifier]. This value must not be nil.
- See also
- JSQMessagesCollectionViewCellIncoming.
- Warning
- Overriding this property's default value is not recommended. You should only override this property's default value if you are proividing your own cell prototypes. These prototypes must be registered with the collectionView for reuse and you are then responsible for completely overriding many delegate and data source methods for the collectionView, including
collectionView:cellForItemAtIndexPath:.
| - (NSString*) incomingMediaCellIdentifier |
|
readwritenonatomiccopy |
The collection view cell identifier to use for dequeuing incoming message collection view cells in the collectionView for media messages.
This cell identifier is used for incoming media message data items. The default value is the string returned by [JSQMessagesCollectionViewCellIncoming mediaCellReuseIdentifier]. This value must not be nil.
- See also
- JSQMessagesCollectionViewCellIncoming.
- Warning
- Overriding this property's default value is not recommended. You should only override this property's default value if you are proividing your own cell prototypes. These prototypes must be registered with the collectionView for reuse and you are then responsible for completely overriding many delegate and data source methods for the collectionView, including
collectionView:cellForItemAtIndexPath:.
Returns the input toolbar view object managed by this view controller. This view controller is the toolbar's delegate.
Returns the keyboard controller object used to manage the software keyboard.
| - (NSString*) outgoingCellIdentifier |
|
readwritenonatomiccopy |
The collection view cell identifier to use for dequeuing outgoing message collection view cells in the collectionView for text messages.
This cell identifier is used for outgoing text message data items. The default value is the string returned by [JSQMessagesCollectionViewCellOutgoing cellReuseIdentifier]. This value must not be nil.
- See also
- JSQMessagesCollectionViewCellOutgoing.
- Warning
- Overriding this property's default value is not recommended. You should only override this property's default value if you are proividing your own cell prototypes. These prototypes must be registered with the collectionView for reuse and you are then responsible for completely overriding many delegate and data source methods for the collectionView, including
collectionView:cellForItemAtIndexPath:.
| - (NSString*) outgoingMediaCellIdentifier |
|
readwritenonatomiccopy |
The collection view cell identifier to use for dequeuing outgoing message collection view cells in the collectionView for media messages.
This cell identifier is used for outgoing media message data items. The default value is the string returned by [JSQMessagesCollectionViewCellOutgoing mediaCellReuseIdentifier]. This value must not be nil.
- See also
- JSQMessagesCollectionViewCellOutgoing.
- Warning
- Overriding this property's default value is not recommended. You should only override this property's default value if you are proividing your own cell prototypes. These prototypes must be registered with the collectionView for reuse and you are then responsible for completely overriding many delegate and data source methods for the collectionView, including
collectionView:cellForItemAtIndexPath:.
| - (NSString*) senderDisplayName |
|
readwritenonatomiccopy |
The display name of the current user who is sending messages.
This value does not have to be unique. This value must not be nil.
The string identifier that uniquely identifies the current user sending messages.
This property is used to determine if a message is incoming or outgoing. All message data objects returned by collectionView:messageDataForItemAtIndexPath: are checked against this identifier. This value must not be nil.
| - (BOOL) showLoadEarlierMessagesHeader |
|
readwritenonatomicassign |
Specifies whether or not the view controller should show the "load earlier messages" header view.
Setting this property to YES will show the header view immediately. Settings this property to NO will hide the header view immediately. You will need to scroll to the top of the collection view in order to see the header.
| - (BOOL) showTypingIndicator |
|
readwritenonatomicassign |
Specifies whether or not the view controller should show the typing indicator for an incoming message.
Setting this property to YES will animate showing the typing indicator immediately. Setting this property to NO will animate hiding the typing indicator immediately. You will need to scroll to the bottom of the collection view in order to see the typing indicator. You may use scrollToBottomAnimated: for this.
| - (CGFloat) topContentAdditionalInset |
|
readwritenonatomicassign |
Specifies an additional inset amount to be added to the collectionView's contentInsets.top value.
Use this property to adjust the top content inset to account for a custom subview at the top of your view controller.
The documentation for this class was generated from the following files:
- Vendors/JSQMessagesViewController/Controllers/JSQMessagesViewController.h
- Vendors/JSQMessagesViewController/Controllers/JSQMessagesViewController.m