#import <JSQMessagesCollectionViewDataSource.h>
An object that adopts the JSQMessagesCollectionViewDataSource protocol is responsible for providing the data and views required by a JSQMessagesCollectionView. The data source object represents your app’s messaging data model and vends information to the collection view as needed.
| - (NSAttributedString *) collectionView: |
|
(JSQMessagesCollectionView *) |
collectionView |
| attributedTextForCellBottomLabelAtIndexPath: |
|
(NSIndexPath *) |
indexPath |
|
|
| |
|
optional |
Asks the data source for the text to display in the cellBottomLabel for the the specified message data item at indexPath in the collectionView.
- Parameters
-
| collectionView | The object representing the collection view requesting this information. |
| indexPath | The index path that specifies the location of the item. |
- Returns
- A configured attributed string or
nil if you do not want text displayed for the item at indexPath. Return an attributed string with nil attributes to use the default attributes.
- See also
- JSQMessagesCollectionViewCell.
| - (NSAttributedString *) collectionView: |
|
(JSQMessagesCollectionView *) |
collectionView |
| attributedTextForCellTopLabelAtIndexPath: |
|
(NSIndexPath *) |
indexPath |
|
|
| |
|
optional |
Asks the data source for the text to display in the cellTopLabel for the specified message data item at indexPath in the collectionView.
- Parameters
-
| collectionView | The object representing the collection view requesting this information. |
| indexPath | The index path that specifies the location of the item. |
- Returns
- A configured attributed string or
nil if you do not want text displayed for the item at indexPath. Return an attributed string with nil attributes to use the default attributes.
- See also
- JSQMessagesCollectionViewCell.
| - (NSAttributedString *) collectionView: |
|
(JSQMessagesCollectionView *) |
collectionView |
| attributedTextForMessageBubbleTopLabelAtIndexPath: |
|
(NSIndexPath *) |
indexPath |
|
|
| |
|
optional |
Asks the data source for the text to display in the messageBubbleTopLabel for the specified message data item at indexPath in the collectionView.
- Parameters
-
| collectionView | The object representing the collection view requesting this information. |
| indexPath | The index path that specifies the location of the item. |
- Returns
- A configured attributed string or
nil if you do not want text displayed for the item at indexPath. Return an attributed string with nil attributes to use the default attributes.
- See also
- JSQMessagesCollectionViewCell.
Asks the data source for the message bubble image data that corresponds to the specified message data item at indexPath in the collectionView.
- Parameters
-
| collectionView | The object representing the collection view requesting this information. |
| indexPath | The index path that specifies the location of the item. |
- Returns
- An initialized object that conforms to the
JSQMessageBubbleImageDataSource protocol. You may return nil from this method if you do not want the specified item to display a message bubble image.
It is recommended that you utilize JSQMessagesBubbleImageFactory to return valid JSQMessagesBubbleImage objects. However, you may provide your own data source object as long as it conforms to the JSQMessageBubbleImageDataSource protocol.
- Warning
- Note that providing your own bubble image data source objects may require additional configuration of the collectionView layout object, specifically regarding its
messageBubbleTextViewFrameInsets and messageBubbleTextViewTextContainerInsets.
- See also
- JSQMessagesBubbleImageFactory.
-
JSQMessagesCollectionViewFlowLayout.
Asks the data source for the message data that corresponds to the specified item at indexPath in the collectionView.
- Parameters
-
| collectionView | The object representing the collection view requesting this information. |
| indexPath | The index path that specifies the location of the item. |
- Returns
- An initialized object that conforms to the
JSQMessageData protocol. You must not return nil from this method.
| - (NSString *) senderDisplayName |
|
|
|
|
required |
Asks the data source for the current sender's display name, that is, the current user who is sending messages.
- Returns
- An initialized string describing the current sender to display in a
JSQMessagesCollectionViewCell.
- Warning
- You must not return
nil from this method. This value does not need to be unique.
Asks the data source for the current sender's unique identifier, that is, the current user who is sending messages.
- Returns
- An initialized string identifier that uniquely identifies the current sender.
- Warning
- You must not return
nil from this method. This value must be unique.
The documentation for this protocol was generated from the following file: