A smooth, responsive and flexible messages UI library for iOS apps. Built on top of the awesome Texture (formerly AsyncDisplayKit) framework, it takes full advantage of asynchronous layout and rendering to deliver a "butter smooth" scrolling experience.
Source\ directory to your project and install all dependencies.
MessageCellNodeis your friend. Most of the time you don't want to subclass it.
MessageTextBubbleNodefor text based messages and
MessageNetworkImageBubbleNodefor remote image based messages.
AsyncMessagesViewController. As you may see, it's a very simple view controller (and should be). Most of the magic is in the data source.
DefaultAsyncMessagesCollectionViewDataSource. This class keeps a sorted list of messages, but doesn't allow you to change them directly. Instead, you must alter messages using given methods in its protocol and let it handle the heavy work. It can (supposedly) smartly determine which cells need to be inserted, deleted and reloaded. Why? because:
reloadDatais very expensive on
DefaultAsyncMessagesCollectionViewDataSourcecan detect those changes automatically.
MessageCellNodeMetadataprovides runtime-computed information about a message and how its data should be presented in a
MessageCellNode. Metadata of a message is often computed based on the relationship with other messages. For example, message's sender name should be displayed if it is an incoming message and is the first one in a set of consecutive messages sent by a same user. Or message's date should be shown if it is the first message sent within a 15 minutes window. This kind of UI logic is encapsulated in
MessageCellNodeMetadataFactoryand computed at runtime. Of course you can implement your own logic.
DefaultAsyncMessagesCollectionViewDataSourcevia its initializer.
AsyncMessagesViewController(also via its initializer).
MessageBubbleImageProviderwith whatever colors you want.
MessageCellNodeMetadataFactoryand override any neccessary method.
All feedbacks, questions and pull requests are very welcome. See here for details.
Created by Huy Nguyen, an Android developer :)
Copyright © 2015 Huy Nguyen.