This repository has been archived by the owner on Aug 14, 2019. It is now read-only.
Improvements to avatar default, user scrolling, add subtitle support #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, thanks for this great starting point for any messaging application. My use case for this control is for group chat so most of my changes make my use case possible. This PR does a few things:
JSMessagesViewAvatarPolicy
has been added:JSMessagesViewAvatarPolicyOutgoingOnly
. This should be self explanatory.avatarImageForIncomingMessageAtIndexPath:
should now be used in place ofavatarImageForIncomingMessage
, etc. This allows for different avatars depending on the message.JSMessagesViewController
:preventScrollToBottomWhileUserScrolling
. When this is set toYES
, the tableview won't automatically scroll to the bottom when scrollToBottom is called if the user is scrolling the view. This is very useful in busy group chat cases so that users can place their thumb on the screen to read that their own pace instead of constantly being jumped to the bottom.scrollToRowAtIndexPath:atScrollPosition:animated:
. This method respects the property above so that you can continue to program scrolls and still allow the user to read at his/her own pace.hasSubtitleForRowAtIndexPath:
andsubtitleForRowAtIndexPath:
. You can see a screenshot below.I have also taken the liberty of bumping the
podspec
version to2.1.0
and tagging the repo (I'm not sure if the tag merges though).I hope you guys find these changes as useful as I do.