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

Releases: jessesquires/JSQMessagesViewController

Release 7.0.0

17 Mar 03:21
Compare
Choose a tag to compare

JSQMessagesViewController 7.0 is here! 🎉 Overall, this is a minor release, but it contains breaking API changes from the 6.x.x releases.

Breaking API Changes:

  • @protocol JSQMessageData <NSObject>
    Rename required hash method to messageHash (#684)
  • @protocol JSQMessageMediaData <NSObject>
    Rename required hash method to mediaHash (#684)
  • JSQMessagesCollectionViewFlowLayoutInvalidationContext
    The emptyCacheproperty has been renamed to invalidateFlowLayoutMessagesCache (#661)
  • The following method in JSQMessagesAvatarImageFactory no longer calls uppercaseStringWithLocale: on the string passed to userInitials. Callers are now responsible for passing an uppercase string if desired. (#755)
+ (JSQMessagesAvatarImage *)avatarImageWithUserInitials:(NSString *)userInitials
                                        backgroundColor:(UIColor *)backgroundColor
                                              textColor:(UIColor *)textColor
                                                   font:(UIFont *)font
                                               diameter:(NSUInteger)diameter;

Enhancements / New Features:

Refinements to asset loading/organization.

Bug fixes:

See the complete list of issues closed for the 7.0 milestone.

Release 6.1.3

11 Jan 00:04
Compare
Choose a tag to compare

Oops! Sorry! Hot fix for usage of iOS 8-only API in release 6.1.2.

Release 6.1.2

10 Jan 23:38
Compare
Choose a tag to compare

Release 6.1.1

19 Dec 22:45
Compare
Choose a tag to compare

Bug fixes and improvements. Completes milestone 6.1.1, with 12 issues closed.

Many thanks to the following contributors for their pull requests:

Release 6.1.0

24 Nov 00:54
Compare
Choose a tag to compare

Milestone 6.1 is closed!

What's new

The - (NSUInteger)hash method is now required for the JSQMessageData and JSQMessageMediaData protocols. The library has always implemented this for the provided model objects, but you must implement this method if you use custom classes/subclasses for your model objects. This is due to the new caching mechanism introduced in v6.0. See #631 for more details. (Note: you get hash from NSObject, but you should implement it yourself based on your message data.)

Issues closed

Version 6.0.0

09 Nov 23:17
Compare
Choose a tag to compare

This project has reached another exciting milestone! This release includes a lot of refactoring, optimizing, bug fixes, and most notably — media message support. 🎉

Find additional details about this release at issue #476.

See the complete list of closed issues at the 6.0 milestone.

Documentation

You can find the latest documentation here.

Also see the Getting Started guide in the README.

The demo project as also been updated, please use this as a guide.

What's new

Media Messages! 🎉
By far, this has been the most-requested feature for this library. The JSQMessage class has been updated to support media messages. This comes in the form of updates to the JSQMessageData protocol and the addition of a new protocol, JSQMessageMediaData. Additionally, there are 3 built-in media types: photo, video, and location. These are represented by the following 3 classes: JSQPhotoMediaItem, JSQVideoMediaItem, JSQLocationMediaItem. See the corresponding docs for more details.

Further, the library supports asynchronous loading of media. You can use JSQMessagesMediaPlaceholderView to display media items that are "loading".

Also see the JSQMessagesMediaViewBubbleImageMasker for masking custom media item views as bubble images. The built-in media types have an appliesMediaViewMaskAsOutgoing property to specify if the media view is incoming or outgoing.

NOTE: The media message model is extremely and easily extensible. You can easily provide your own custom media items by simply conforming to the JSQMessageMediaData protocol. For instance, you could create a new model object, MyContactMediaItem, that represents a contact (name, phone, address, email, etc.). All you need to do is conform to JSQMessageMediaData and pass this object to a JSQMessage object during initialization. The library will do the rest.

A Refined Model
The JSQMessageData protocol has been updated to include a senderId and senderDisplayName. (This was previously only sender.)

All model objects have been refined and updated, they are:

  • JSQMessage <JSQMessageData> : represents message objects
  • JSQMediaItem <JSQMessageMediaData> : base class for media objects
  • JSQPhotoMediaItem <JSQMessageMediaData> : represents photo attachments
  • JSQLocationMediaItem <JSQMessageMediaData> : represents location attachments
  • JSQVideoMediaItem <JSQMessageMediaData> : represents video attachments
  • JSQMessagesAvatarImage <JSQMessageAvatarImageDataSource> : represents avatars
  • JSQMessagesBubbleImage <JSQMessageBubbleImageDataSource> : represents message bubbles

NOTE: Each of the built-in model classes simply conforms to a specific protocol in the library. This means you can use your existing model objects as long as they conform to the necessary protocols.

JSQMessageBubbleImageDataSource Protocol
This new data source protocol replaces the use of imageView objects for message bubble image views. The messageBubbleImageView of a JSQMessagesCollectionViewCell is now part of the cell prototype. This change is reflected in JSQMessagesCollectionViewDataSource as well as JSQMessagesBubbleImageFactory.

// Changes in JSQMessagesCollectionViewDataSource

// OLD
- (UIImageView *)collectionView:(JSQMessagesCollectionView *)collectionView bubbleImageViewForItemAtIndexPath:(NSIndexPath *)indexPath;

// NEW
- (id<JSQMessageBubbleImageDataSource>)collectionView:(JSQMessagesCollectionView *)collectionView messageBubbleImageDataForItemAtIndexPath:(NSIndexPath *)indexPath;

JSQMessagesBubbleImageFactory
You can now supply your own message bubble images and the factory class now generates JSQMessagesBubbleImage objects using those images. (You can also use the default bubble images.)

JSQMessageAvatarImageDataSource
This new data source protocol replaces the use of imageView objects for avatar image views. The avatarImageView of a JSQMessagesCollectionViewCell is now part of the cell prototype. This change is reflected in JSQMessagesCollectionViewDataSource as well as JSQMessagesAvatarImageFactory.

// Changes in JSQMessagesCollectionViewDataSource

// OLD
- (UIImageView *)collectionView:(JSQMessagesCollectionView *)collectionView avatarImageViewForItemAtIndexPath:(NSIndexPath *)indexPath;

// NEW
- (id<JSQMessageAvatarImageDataSource>)collectionView:(JSQMessagesCollectionView *)collectionView avatarImageDataForItemAtIndexPath:(NSIndexPath *)indexPath;

JSQMessagesAvatarImageFactory
Previously named JSQMessagesAvatarFactory. This factory class now generates JSQMessageAvatarImage objects.

TypingIndicator and LoadEarlierMessagesHeader
The properties how have more customization options. The typingIndicatorColor has been removed from JSQMessagesViewController.

New properties on JSQMessagesCollectionView:

  • typingIndicatorDisplaysOnLeft
  • typingIndicatorMessageBubbleColor
  • typingIndicatorEllipsisColor
  • loadEarlierMessagesHeaderTextColor

JSQMessagesCollectionViewCell
Now has a mediaView property and mediaCellReuseIdentifier.

JSQMessagesViewController
Now has outgoingMediaCellIdentifier and incomingMediaCellIdentifier properties. As before, you may still provide custom cells with custom identifiers. See the docs for more details.

Bug fixes!
See the complete list of bug fixes for details. 🎉

Localization

The library is now localized in 14 languages!

Localization includes the "Send", "New Message", and "Load Earlier Messages" strings. Need a language that isn't supported? Please submit a PR!

This feature was truly a community effort. Thanks to all who contributed! See #237 for details.

Donate

Do you use this library? Are you interesting in contributing or supporting it? Consider donating!

Donations buy me ☕ to work hard and 🍺 to celebrate releases.

Interoperability with Swift

This library uses uses modern Objective-C and follows current best practices to facilitate Swift interoperability. You should not have any issues using this library with Swift, but if you do please open a new issue. Simply add the JSQMessages.h umbrella header to your bridging header for Swift.

Fun stats

As of this release:

  • This library is over 1.5 years old!
  • 433 issues closed
  • 48 releases
  • 1,126 commits
  • 32 contributors

Release 5.3.0

01 Sep 19:36
Compare
Choose a tag to compare

What's new

  • Improved handling of the copy menu (UIMenuController) for a cell (activated by a long press gesture on a cell). It is now much more reliable and does not dismiss the keyboard when appearing.
  • You can now add your own custom menu options/actions to the menu! Simply override the following delegate methods in your view controller subclass. Don't forget to call super at the end of each.
- (BOOL)collectionView:(UICollectionView *)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath *)indexPath;

- (BOOL)collectionView:(UICollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;

- (void)collectionView:(UICollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
  • New properties available on JSQMessagesCollectionViewCell! The following private properties have now been exposed. Use with caution. See the most recent documentation for details.
@property (weak, nonatomic, readonly) UIView *messageBubbleContainerView;
@property (weak, nonatomic, readonly) UIView *avatarContainerView;
  • The following has been removed from JSQMessagesCollectionViewCell. (Due to the changes regarding the UIMenuController above)
@property (weak, nonatomic, readonly) UILongPressGestureRecognizer *longPressGestureRecognizer;

Issues resolved

Release 5.2.0

28 Jul 06:48
Compare
Choose a tag to compare

What's new

New delegate methods!

- (void)collectionView:(JSQMessagesCollectionView *)collectionView didTapMessageBubbleAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(JSQMessagesCollectionView *)collectionView
 didTapCellAtIndexPath:(NSIndexPath *)indexPath
         touchLocation:(CGPoint)touchLocation;

New view controller properties!

@property (assign, nonatomic) CGFloat topContentAdditionalInset;

Check the most recent documentation for details!

Release 5.1.0

22 Jul 06:40
Compare
Choose a tag to compare

What's new

  • Springiness is now disabled by default, and labeled as an experimental feature in the docs. It is mostly stable, but not quite perfected. In order to opt-in, set this property to YES:
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    self.collectionView.collectionViewLayout.springinessEnabled = YES;
}
  • Better KVO handling, no longer hits the exception breakpoint. (#285)
  • Showing the typingIndicator footer and loadEarlierMessages header now display reliably. However, some minor UI issues still sometimes occur if springiness is enabled.
  • When setting self.showTypingIndicator = YES, you now need to scroll to the bottom yourself, using scrollToBottomAnimated:
  • Lots of other bug fixes and improvements! (see below)
  • Docs updated for changes

Issues closed

Release 5.0.3 - performance improvements

26 May 19:17
Compare
Choose a tag to compare

This release provides some significant performance improvements!

Issues closed:

Other:

  • Improved keyboard notification, see #287