All Projects → ekazaev → Chatlayout

ekazaev / Chatlayout

Licence: mit
ChatLayout is an alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation as well as all the tools available in UICollectionView. It supports dynamic cells and supplementary view sizes.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Chatlayout

Webapp
Tinode web chat using React
Stars: ✭ 156 (-15.22%)
Mutual labels:  chat, messaging, messenger, chat-application
Falconmessenger
🌟🌟🌟🌟🌟 Falcon Messenger is a Fast and Beautiful cloud-based messaging app. With iOS and IPadOS Support. Available on the App Store.
Stars: ✭ 310 (+68.48%)
Mutual labels:  chat, messaging, messenger, chat-application
Messenger
Open source, native iOS Messenger, with realtime chat conversations (full offline support).
Stars: ✭ 4,264 (+2217.39%)
Mutual labels:  chat, messaging, messenger, chat-application
Applozic Ios Sdk
iOS Real Time Chat & Messaging SDK
Stars: ✭ 104 (-43.48%)
Mutual labels:  chat, messaging, messenger, chat-application
Chat
Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots
Stars: ✭ 8,238 (+4377.17%)
Mutual labels:  chat, messaging, messenger, chat-application
Im service
golang im server
Stars: ✭ 1,694 (+820.65%)
Mutual labels:  chat, messaging, messenger, chat-application
Carlenscollectionviewlayout
An easy-to-use Collection View Layout for card-like animation.
Stars: ✭ 478 (+159.78%)
Mutual labels:  uicollectionviewlayout, uicollectionview, collectionview
Chat21 Ios Sdk
DEPRECATED
Stars: ✭ 15 (-91.85%)
Mutual labels:  chat, messaging, chat-application
Igdm
Desktop application for Instagram DMs
Stars: ✭ 1,880 (+921.74%)
Mutual labels:  chat, messenger, chat-application
Flowlayout
UICollectionView WaterFlowLayout. 瀑布流.
Stars: ✭ 94 (-48.91%)
Mutual labels:  uicollectionviewlayout, uicollectionview, collectionview
Swiftychat
SwiftUI Chat UI (Client) Framework & Documentation to get started!
Stars: ✭ 50 (-72.83%)
Mutual labels:  chat, messaging, chat-application
Sum
SUM - Secure Ultimate Messenger
Stars: ✭ 154 (-16.3%)
Mutual labels:  chat, messaging, messenger
Messenger Ios Chat Swift Firestore
Messenger Clone - Real-time iOS Chat with Firebase Firestore written in Swift
Stars: ✭ 405 (+120.11%)
Mutual labels:  chat, messaging, messenger
Bouncylayout
Make. It. Bounce.
Stars: ✭ 4,035 (+2092.93%)
Mutual labels:  uicollectionviewlayout, uicollectionview, collectionview
Android yichat lite
android client
Stars: ✭ 118 (-35.87%)
Mutual labels:  chat, messaging, chat-application
Realtimechat
Open source, native iOS Messenger, with realtime chat conversations (full offline support).
Stars: ✭ 1,511 (+721.2%)
Mutual labels:  chat, messenger, chat-application
Ios
Tinodios: Tinode Messaging Client for iOS
Stars: ✭ 119 (-35.33%)
Mutual labels:  chat, messenger, chat-application
Stream Chat Swift
Official iOS SDK for Stream Chat
Stars: ✭ 277 (+50.54%)
Mutual labels:  chat, messaging, chat-application
Mercurius
Real-time Messenger for Laravel
Stars: ✭ 309 (+67.93%)
Mutual labels:  chat, messenger, chat-application
Collectionviewslantedlayout
A CollectionView Layout displaying a slanted cells
Stars: ✭ 2,029 (+1002.72%)
Mutual labels:  uicollectionviewlayout, uicollectionview, collectionview

Websummit

ChatLayout

CI Status Release Version Documentation Codecov Codacy Badge Swift Package Manager Carthage compatible Swift 5.2 Platform iOS

Table of contents

About

ChatLayout is an alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation as well as all the tools available in UICollectionView.

Features

  • Supports dynamic cells and supplementary view sizes.
  • Animated insertion/deletion/reloading/moving of the items.
  • Keeps content of the last visible item at the top or bottom of the UICollectionView during updates.
  • Provides tools for precise scrolling to the required item.
  • Shipped with generic container views to simplify the custom items implementation.

What ChatLayout doesn't provide (And why it is good)

ChatLayout is the custom UICollectionViewLayout, so:

  • You don't have to extend or override any custom UIViewController or UICollectionView. You need to instantiate them yourself and use them the way you like.

  • ChatLayout does not rely on modified UICollectionViewFlowLayout nor does it rotate your UICollectionView upside-down. This means you can use your views as if they would be regular cells within UICollectionView. You can benefit from using the default UIKit implementations of adjustedContextInsets (and others) because your view controller is a normal view controller without any hacks or tricks.

  • ChatLayout doesn't require you to calculate all the cell sizes before it renders them on the screen. You can fully use auto-layout constraints and rely on the fact that the correct size will be calculated in the runtime. However, ChatLayout as any other UICollectionViewLayout will benefit from you providing the estimated sizes of your cells as it will allow you to get better performance.

  • ChatLayout doesn't enforce you to use any specific data model. You can store your messages and update UICollectionView the way you like. The only thing you need is to respect the natural boundaries that UICollectionView have and correctly implement UICollectionViewDataSource. The Example app uses DifferenceKit to process changes in the data model.

  • ChatLayout doesn't enforce you to use any specific UIViews to create your collection cells. You can create them the way you like. It can be any UICollectionViewCell or UICollectionReusableView. There are some generic UIViews bundled with the library that may help you to build them faster. However, you do not have to use them.

  • ChatLayout doesn't handle the keyboard appearance behavior. You have to implement that yourself from scratch or use the library you are already using in your project. It gives you full control over the keyboard presentation. The only thing you have to do is to update the contentInsets of your UICollectionView.

  • ChatLayout doesn't provide you any input control. You can use any one you like and customise it the way you like. The Example app for instance uses InputBarAccessoryView.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

ChatLayout is available through CocoaPods, Carthage and SwiftPM. See the Example app for the usage details.

If you are using cocoapods you can install the whole package using pod 'ChatLayout'. If you do not need the additional components provided, you can install only the layout itself using pod 'ChatLayout/Core'

Contributing

ChatLayout is in active development, and we welcome your contributions.

If you’d like to contribute to this repo, please read the contribution guidelines.

Todo

  • [ ] Improve the test coverage

About UICollectionViewDiffableDataSource

ChatLayout can process any update commands that you send to your UICollectionView, so you can use UICollectionViewDiffableDataSource as well. But you have to keep in mind that UICollectionViewDiffableDataSource does not support the reloading of cells out of the box if you are relying on the Hashable protocol implementation. It will delete the changed cell and insert the new version of said cell. That may lead to strange animations on the screen, especially when the reloaded cell changes its size. In order to get the best behaviour of the update animation I would strongly recommend you rely on DifferenceKit or a similar library to process the model changes. The Example app does it as well.

About Supplementary Views

It can be tempting and it may look like it is the right way to go, but do not use supplementary views to decorate your messages or groups of them. UICollectionView processes them in a different order: UICollectionViewCells first and only after switches to UICollectionReusableViews. You will most likely face some unexpected behaviour during the animation.

About Texture

ChatLayout can be used together with Texture to improve the auto-layout performance. But keep in mind that it's default wrapper is hardcoded to work exclusively with UICollectionViewFlowLayout. See issue. You will have to implement ChatLayoutDelegate yourself and propagate the node size manually.

About animation

If you see a strange or unexpected animation during the updates, check your data model and the commands you send to the UICollectionView's performBatchUpdates. Especialy if you are using some diffing algorithms like DifferenceKit. It is very possible that you are sending delete/insert commands when you expect to see reload. The easiest way to check it is by adding print("\(updateItems)") into ChatLayout.prepare(forCollectionViewUpdates:) method. ChatLayout doesn't know what you expected to see. It just processes your changes according to the commands it has received.

License

ChatLayout is distributed under the MIT license.

ChatLayout is provided for your use, free-of-charge, on an as-is basis. We make no guarantees, promises or apologies. Caveat developer.

Articles

English:

Russian:

Author

Evgeny Kazaev, [email protected]. Twitter ekazaev

I am happy to answer any questions you may have. Just create a new issue.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].