Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Commit

Permalink
Create FAQ.md
Browse files Browse the repository at this point in the history
close #1387
  • Loading branch information
jessesquires committed Jan 10, 2016
1 parent 419a142 commit 88f2a90
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# FAQ

*Frequently asked questions for JSQMessagesViewController*

------------------------------------

##### *Springy bubbles?*
````objective-c
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.collectionView.collectionViewLayout.springinessEnabled = YES;
}
````

##### *Remove avatars?*
````objective-c
- (void)viewDidLoad
{
[super viewDidLoad];
self.collectionView.collectionViewLayout.incomingAvatarViewSize = CGSizeZero;
self.collectionView.collectionViewLayout.outgoingAvatarViewSize = CGSizeZero;
}

- (id<JSQMessageAvatarImageDataSource>)collectionView:(JSQMessagesCollectionView *)collectionView avatarImageDataForItemAtIndexPath:(NSIndexPath *)indexPath
{
return nil;
}
````

##### *Customize your cells?*
````objective-c
- (UICollectionViewCell *)collectionView:(JSQMessagesCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
JSQMessagesCollectionViewCell *cell = (JSQMessagesCollectionViewCell *)[super collectionView:collectionView cellForItemAtIndexPath:indexPath];

// Customize the shit out of this cell
// See the docs for JSQMessagesCollectionViewCell

return cell;
}
````

##### *Customize your toolbar buttons?*
````objective-c
- (void)viewDidLoad
{
[super viewDidLoad];

// This button will call the `didPressAccessoryButton:` selector on your JSQMessagesViewController subclass
self.inputToolbar.contentView.leftBarButtonItem = /* custom button or nil to remove */

// This button will call the `didPressSendButton:` selector on your JSQMessagesViewController subclass
self.inputToolbar.contentView.rightBarButtonItem = /* custom button or nil to remove */

// Swap buttons, move send button to the LEFT side and the attachment button to the RIGHT
// For RTL language support
self.inputToolbar.contentView.leftBarButtonItem = [JSQMessagesToolbarButtonFactory defaultSendButtonItem];
self.inputToolbar.contentView.rightBarButtonItem = [JSQMessagesToolbarButtonFactory defaultAccessoryButtonItem];

// The library will call the correct selector for each button, based on this value
self.inputToolbar.sendButtonOnRight = NO;
}
````

0 comments on commit 88f2a90

Please sign in to comment.