# MessageKit: a UIKit chat UI for iOS, and what it does not do

> MessageKit is a community-driven replacement for JSQMessagesViewController, distributed as a Swift Package and requiring iOS 14 and Swift 6. It draws the chat screen; message transport and storage stay your job.

**MessageKit/MessageKit** — A community-driven replacement for JSQMessagesViewController

- Repository: https://github.com/MessageKit/MessageKit
- Website: https://messagekit.github.io
- Stars: 6,270 · Forks: 1,200
- Language: Swift
- License: MIT
- Published: 2026-09-22 · Updated: 2026-09-22 · Language: en
- Canonical page: https://hysenlabs.com/projects/messagekit-messagekit

## What MessageKit replaces, and who ends up using it

JSQMessagesViewController was the default answer for an iOS chat screen for years, and it stopped being maintained. MessageKit exists as a community-driven replacement for it, which tells you both the audience and the shape of the library. The audience is iOS developers with an existing UIKit app who need a conversation view and do not want to write one. The shape is a rendering layer: it draws bubbles, avatars, timestamps and an input bar, and it expects you to supply the messages.

That split matters more than any feature list. MessageKit has no networking, no persistence, no delivery receipts and no server component. If you are looking for a chat backend, this is the wrong repository entirely. If you already have messages in memory or in a local store and need them on screen with correct sizing and scrolling, the library is aimed exactly at you.

## MessagesCollectionView, MessageKind and the delegate pair

The core is a collection view subclass. Each visible message is a cell, and the cell type is chosen from the message's MessageKind. The README lists the built-in cases: text, attributedText, photo, video, location, emoji, audio, contact and linkPreview, each mapped to a cell such as TextMessageCell, MediaMessageCell, LocationMessageCell, AudioMessageCell, ContactMessageCell or LinkPreviewMessageCell.

The default cell is a subclass of MessageContentCell and is assembled from seven parts. From top down the README names cellTopLabel, messageTopLabel, messageContainerView, messageBottomLabel and cellBottomLabel, with avatarView and accessoryView on either side. You can resize, restyle and repad each part, which is how most visual customization is done without writing a cell from scratch.

Two protocols carry the integration. MessagesDataSource supplies the messages and the sender information; MessagesLayoutDelegate supplies sizes and spacing. The layout delegate is the part people underestimate. Because cells are sized per message, anything that changes height, such as a long text body, an image with an unknown aspect ratio or a link preview, has to be answered there or the collection view will scroll badly.

The escape hatch is MessageKind.custom. The README is explicit that choosing it makes you responsible for the entire cell layout, and that styling applied through MessageDisplayDelegate will not affect your custom cell even if you subclass MessageContentCell. There is a CUSTOM_CELLS.md document in Documentation/ for that path.

## Installing MessageKit with Swift Package Manager

Swift Package Manager is the recommended route. The README notes that Swift 5.3 in Xcode 12 added support for assets in Swift Packages, which is what makes the packaged resources work. In Xcode you add the package by its repository URL:

```
https://github.com/MessageKit/MessageKit
```

Older Swift and Xcode versions do not support MessageKit through SPM, so those projects have to use the manual installation document instead. The requirements section is strict: iOS 14 or later and Swift 6 or later. The README gives version fallbacks rather than a compatibility matrix, and they are worth reading before you upgrade anything: version 4.3.0 for iOS 13 or Swift 5.x, version 3.8.0 for iOS 12 or CocoaPods, version 3.3.0 for iOS 11, and version 3.1.1 for iOS 9 and iOS 10. The 5.0.0 release is described in the release list as the Swift 6 and Swift Concurrency release, which lines up with the stated Swift 6 requirement.

For a first real use, the repository ships an Example project rather than a snippet in the README. The README points at Example/ and recommends starting there. Clone the repository and open the workspace:

```bash
git clone https://github.com/MessageKit/MessageKit.git
cd MessageKit
open Example/ChatExample.xcworkspace
```

The Example target is a working chat screen with the default cells, so it is the fastest way to see what MessageContentCell's seven parts look like when they are populated. There is also a Makefile at the repository root. It builds against a generic iOS Simulator destination and resolves an available iPhone simulator for tests, with an override available as `make test SIMULATOR_ID=<udid>`. That is a build-and-test entry point for the library itself, not a substitute for the Quick Start guide in Documentation/QuickStart.md, which is where the README sends you for wiring your own data source.

## Where MessageKit stops being the right tool

The largest limitation is the one already implied by the design: MessageKit does not know what a message is beyond the MessageType you hand it. There is no store, no pagination helper, no conflict resolution and no read-state model. Every product decision about history loading, optimistic sends and failure states is yours. Teams that pick this expecting a chat product rather than a chat view will spend the same time they would have spent writing the view.

The second limitation is the custom cell case. MessageKind.custom removes the library's help rather than extending it. The README states that any UICollectionViewCell can be returned, that you own the layout, and that MessageDisplayDelegate styling will not apply. If your design has one unusual bubble type, you pay for it in a separate cell class and a separate size calculator.

The third is the platform floor. iOS 14 and Swift 6 is a modern baseline, and the README's answer for anyone below it is to pin an older major version. That is a reasonable policy, but it means a project on iOS 13 stays on 4.3.0 and does not receive the 5.x line. CocoaPods users are in the same position at 3.8.0, and the README does not present CocoaPods as a supported path for current versions.

Finally, the input bar is not MessageKit's own code. The README describes InputBarAccessoryView as a third-party dependency from nathantannar4/InputBarAccessoryView, and says the MessageInputBar is based on it. Customizing input behaviour therefore means learning a second project's API, and the README links to that repository and to Documentation/MessageInputBar.md rather than documenting the internals here.

## MessageKit against SwiftUI chat layouts and SwiftMessages

The realistic alternative for a new iOS app is not another UIKit chat library but SwiftUI's List and ScrollView, with your own bubble views. The difference in approach is structural. MessageKit is a UICollectionView with a data source and a layout delegate, so sizing is computed by delegate callbacks and cells are reused by the collection view. A SwiftUI chat is a view hierarchy driven by state, where sizing comes from the layout system and there is no delegate pair to implement. If your app is already SwiftUI, adding MessageKit means hosting a UIViewControllerRepresentable around a UIKit view, which is a real cost that the repository does not try to hide; the README and the documentation describe a UIKit component.

SwiftMessages appears in the same searches, but it solves a different problem: it presents transient banners and messages over the current screen. It is not a conversation view and does not compete with MessageKit on cells, avatars or an input bar. Treating them as alternatives is a category error.

The honest comparison is therefore between MessageKit and writing the collection view yourself. MessageKit wins on the parts that are tedious and easy to get wrong: cell reuse for heterogeneous message types, per-message sizing, avatar and accessory placement, and an input bar with a maintained upstream. It loses when your chat is simple enough that a plain UITableView with one cell type is a week of work, or when your interface is SwiftUI end to end.

## Maintenance, licence and upgrade cost

The repository is not archived, and the last push was on 2026-09-17. Releases are infrequent rather than continuous: 5.0.0 on 2024-12-06, 4.3.0 on 2024-10-14, and 4.2.0 on 2023-08-23 before that. A library that ships a major version roughly once a year is normal for a UI component, but it means a fix you need may sit on main for a while before it reaches a tagged release. Pin to a tag rather than to a branch if that matters to you.

The upgrade cost is concentrated in the 4.x to 5.x step. The 5.0.0 release is tied to Swift 6 and Swift Concurrency, and the README's requirement of Swift 6 or later follows from it. A project that cannot move to Swift 6 stays on 4.3.0, which the README lists as the version for Swift 5.x. Because MessageKind, MessagesDataSource and MessagesLayoutDelegate are the surface you implement, any change to those types is the change that will touch your code; the release notes are the place to check that before upgrading.

MessageKit is MIT licensed, and the Makefile carries the same MIT notice with a 2017-2022 copyright range. MIT is permissive: it allows commercial and closed-source use, requires the copyright notice and permission notice to be included, and provides the software as is without warranty. The dependency on InputBarAccessoryView is a separate project with its own licence, so if you ship an app you are carrying two licences rather than one. This is a description of the terms, not legal advice; read LICENSE.md and the dependency's licence before you rely on either.

## Conclusion

Adopt MessageKit when you have a UIKit app, a working message backend, and you want the collection view, cell sizing and input bar handled for you. Do not adopt it if you need SwiftUI, if you are still on iOS 13 or Swift 5.x (the README points those projects at 4.3.0, and CocoaPods users at 3.8.0), or if you expect the library to send, persist or sync messages, which it does not. Before writing code, verify three things: that your Xcode is 16 or later, that the Example/ChatExample.xcworkspace builds, and that your own data model can satisfy MessagesDataSource and MessagesLayoutDelegate, since those two protocols are where most integration work lands.

## FAQ

### How do I install MessageKit in an iOS project?

The recommended route is Swift Package Manager: add the package by entering its repository URL, https://github.com/MessageKit/MessageKit, as a package dependency in Xcode. The README notes that older Swift and Xcode versions do not support MessageKit through SPM and should use the manual installation document instead.

### Does MessageKit work with SwiftUI?

The README and documentation describe a UIKit component built on a collection view with a data source and layout delegate, and there is no SwiftUI interface documented. Using it from a SwiftUI app means wrapping the UIKit view yourself, which is not covered in the README.

### What iOS and Swift versions does MessageKit require?

The README states iOS 14 or later and Swift 6 or later. For older targets it gives version fallbacks: 4.3.0 for iOS 13 or Swift 5.x, 3.8.0 for iOS 12 or CocoaPods, 3.3.0 for iOS 11, and 3.1.1 for iOS 9 and iOS 10.

### Does MessageKit send or store messages?

No. MessageKit renders the conversation and provides the input bar; the README describes it as a chat UI library and does not document any networking, persistence or delivery mechanism. You supply messages through MessagesDataSource and handle sending yourself.

### Can I use a custom message cell with MessageKit?

Yes, through the MessageKind.custom case, but the README states that you become responsible for all of the cell layout, that any UICollectionViewCell can be returned, and that MessageDisplayDelegate styling will not affect your custom cell even if it subclasses MessageContentCell. Documentation/CUSTOM_CELLS.md covers the approach.

## Sources

- [License: MIT](https://github.com/MessageKit/MessageKit/blob/main/LICENSE)
- [MessageKit/MessageKit on GitHub](https://github.com/MessageKit/MessageKit)
- [Project website](https://messagekit.github.io)
- [README](https://github.com/MessageKit/MessageKit/blob/main/README.md)
- [Releases](https://github.com/MessageKit/MessageKit/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/messagekit-messagekit
