Skip to content
CAI
Software that uses CAICheck a score

MessageKit/MessageKit

63.5

Adequate · 30 September 2026

11.3k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

MessageKit is a UIKit-based framework for building chat interfaces in iOS applications, providing a collection view layout system and cell implementations for various message types including text, media, audio, contacts, and link previews. It supports modern iOS development patterns through SwiftUI integration and offers extensive customization options for message styling, input bars, and layout calculations. The system includes built-in features for typing indicators, text detection, and keyboard management, with a comprehensive example app demonstrating these capabilities.

How it got here

2017 — Swift 6 migration and rich media support

18 changes.

The project underwent a major overhaul to enforce Swift 6 concurrency, drop legacy iOS 12 support, and migrate its build infrastructure to Swift Package Manager. This period introduced comprehensive support for rich message types including audio, contacts, link previews, and location data, alongside significant refactoring of the layout and view architecture to improve maintainability and modernize the example application.

2018–2026 — Example app overhaul and test coverage

17 changes.

This period focused on significantly expanding the Example application with modular view controllers, custom layout calculators, and a new SwiftUI integration to demonstrate advanced customization features. Concurrently, the project established a robust testing foundation by adding comprehensive unit tests for models, views, and layout logic, while also enforcing code formatting via pre-commit hooks.

Features

Add MessageReusableView base class for collection view headers and footers

A new MessageReusableView class has been added to the Sources/Views/HeadersFooters directory, providing a reusable base class for collection view headers and footers. This class inherits from UICollectionReusableView and includes standard initializers, serving as a foundation for custom header and footer views in the UI layer.

Sources/Views/HeadersFooters · high confidence

Added example app resources and configuration

The Example project now includes the necessary asset catalog entries for the app icon, various UI icons (such as at-sign, hashtag, and map marker), and sample images, along with a LaunchScreen storyboard and an Info.plist defining permissions for camera and photo library access.

Example/Sources/Resources · high confidence

Example app now includes SwiftUI integration and custom input bar support

The ChatExample project has been updated to demonstrate modern iOS development patterns. It now includes a SwiftUI example view (\SwiftUIExampleView\) that binds to \MessagesView\, allowing users to see how to integrate MessageKit within SwiftUI applications. Additionally, the example showcases how to customize the input bar by including a \CameraInputBarAccessoryView\ and a \CustomInputBarExampleViewController\, providing a reference for implementing custom input behaviors.

Example/ChatExample.xcodeproj · high confidence

Expanded message model types and layout configuration options

The \Sources/Models\ directory has been refactored to support richer message content and more granular layout control. \MessageKind\ now includes dedicated cases for audio, contact, and link preview messages, alongside the existing text, media, and location types. Layout customization is enhanced with new models: \AccessoryPosition\ and \AvatarPosition\ allow precise vertical and horizontal alignment of accessory and avatar views within cells, while \LabelAlignment\ provides control over text insets and alignment. Additionally, \DetectorType\ now supports custom regular expressions, hashtags, and mentions, and \LocationMessageSnapshotOptions\ exposes configuration for map snapshot generation.

Sources/Models · high confidence

Introduction of new view components for message styling and typing indicators

This change adds several new view classes to the Sources/Views directory to support enhanced message presentation and user feedback. AvatarView provides a customizable view for displaying user initials with automatic font scaling and corner radius adjustments. MessageContainerView handles the application of various message styles (bubbles, tails, outlines) using image masking. LinkPreviewView introduces a dedicated UI for displaying link previews with title, teaser, and domain labels alongside an image. TypingBubble and TypingIndicator implement the animated three-dot typing indicator UI, including pulse and bounce animations. Additionally, InsetLabel allows for custom text insets within labels, BubbleCircle ensures views remain perfectly circular, and PlayButtonView provides a styled play button for audio messages.

Sources/Views · high confidence

New SwiftUI example demonstrating message list and input integration

The example app now includes a SwiftUI-based chat interface (\SwiftUIExampleView\) that wraps the existing UIKit \MessagesViewController\ via \UIViewControllerRepresentable\. This new view allows users to see how to integrate MessageKit's message collection and input bar into a SwiftUI hierarchy, including handling data binding for messages, configuring the coordinator for delegates, and managing safe area insets to ensure the input bar sits correctly above the keyboard.

Example/Sources/Views/SwiftUI · high confidence

The \Sources/Views/Cells\ directory now includes dedicated cell classes for displaying audio, contact, link preview, location, and media messages. \AudioMessageCell\ provides a play button, progress view, and duration label for audio content. \ContactMessageCell\ displays contact initials and names with a disclosure indicator. \LinkPreviewMessageCell\ renders link previews with titles, teasers, and thumbnails. \LocationMessageCell\ generates and displays map snapshots with annotations. \MediaMessageCell\ handles photos and videos with an optional play button overlay. These cells integrate with the existing \MessageContentCell\ base class and delegate protocols to support configuration, layout, and interaction handling for these specific message types.

Sources/Views/Cells · high confidence

New example app data generation utilities

The Example app now includes a dedicated data generation module with \Lorem.swift\ for producing random text content and \SampleData.swift\ for providing mock users, message types (including text, photos, audio, and contact sharing), and helper methods to populate the chat interface with sample data.

Example/Sources/Data Generation · high confidence

New example app model layer with custom layout calculators and mock data

The Example project's model layer has been replaced with a new set of files to support the updated chat interface. CustomLayoutSizeCalculator and CustomTextLayoutSizeCalculator provide custom sizing logic for message cells, while MockMessage, MockUser, and MockSocket supply mock data and simulated real-time messaging behavior for demonstration purposes.

Example/Sources/Models · high confidence

New example app structure with advanced layout and input customization

The example application has been restructured into a modular set of view controllers, introducing dedicated examples for custom message layouts, custom input bars, and subview-based input positioning. A new \CustomMessagesFlowLayout\ and \CustomMessageSizeCalculator\ allow for tailored message sizing, while \CustomInputBarExampleViewController\ demonstrates replacing the default input bar with a custom view. The \MessageSubviewViewController\ shows how to position the input bar as a subview rather than an accessory view, and the \LaunchViewController\ now serves as a central hub to navigate these distinct examples, including a new SwiftUI integration.

Example/Sources/View Controllers · high confidence

New example views for custom message layouts and camera input

The Example app now includes new view components to demonstrate advanced customization: a CameraInputBarAccessoryView that adds a camera button to the input bar for picking images from the library or camera, and a set of custom cell classes (CustomCell, CustomMessageContentCell, CustomTextMessageContentCell) that show how to implement custom message layouts with top and bottom labels, along with a basic TableViewCell for configuration screens.

Example/Sources/Views · high confidence

New protocol definitions for message types and cell interactions

The \Sources/Protocols\ area now includes the foundational protocol definitions that enable new message capabilities and finer-grained UI control. Specifically, \AudioItem\, \ContactItem\, \LinkItem\, \LocationItem\, and \MediaItem\ protocols are introduced to represent the data structures for audio, contact sharing, link previews, location, and media messages respectively. Additionally, \MessageCellDelegate\ is added to expose tap events for various cell subviews (background, avatar, labels, accessory view, images, and audio controls), while \MessageLabelDelegate\ handles taps on detected text patterns like URLs, mentions, and hashtags. The \MessageType\ protocol is also defined here to standardize the message interface, and \SenderType\ is updated to use \senderId\ for identification.

Sources/Protocols · high confidence

The layout system now includes dedicated size calculators for audio, contact, link preview, location, and media (photo/video) message types, alongside a base \CellSizeCalculator\ class. \MessagesCollectionViewFlowLayout\ registers these calculators as lazy properties and routes message sizing to them based on \MessageKind\, ensuring that audio and location items maintain aspect ratio, media items are sized correctly, contact messages use specific label insets and fonts, and link previews calculate container sizes for titles, teasers, and domains with appropriate font scaling.

Sources/Layout · high confidence

New utility extensions for the Example app

The Example app now includes several new helper extensions in the Extensions module: AlertService for presenting alerts, UserDefaults extensions for managing launch state and mock message counts, a UIColor extension defining a primary color, and UIViewController extensions for accessing the key window root and updating navigation title views.

Example/Sources/Extensions · high confidence

Removals

Removal of MessageKit umbrella header

The MessageKit umbrella header (MessageKit.h) has been removed from the project. This file previously exposed the framework's version number and string constants to importing code; its deletion means consumers can no longer access these specific versioning symbols via the umbrella header.

MessageKit · high confidence

Removal of legacy Xcode project file

The \MessageKit.xcodeproj\ directory, including the \project.pbxproj\ file and user-specific scheme management, has been completely removed from the repository. This indicates that the project no longer uses the traditional Xcode workspace structure for its primary build configuration, likely having migrated to a different package manager or build system.

MessageKit.xcodeproj · high confidence

Architecture

Refactor MessagesViewController into focused extensions

The MessagesViewController implementation has been reorganized into distinct, single-responsibility extensions (Keyboard, Menu, PanGesture, State, TypingIndicator, UIScrollViewDelegate) to improve maintainability. This change introduces a dedicated State class to encapsulate internal properties like the pan gesture and dispose bag, and moves keyboard observation logic to use Combine publishers for more robust handling of input bar height changes and text editing events.

Sources/Controllers · high confidence

Behavioural changes

Added ChatExample workspace configuration

The Example project now includes a dedicated workspace file (ChatExample.xcworkspace) that references the ChatExample.xcodeproj, enabling proper management of multiple targets and dependencies for the example application.

Example/ChatExample.xcworkspace · high confidence

Added pre-commit hook for Swift code formatting

A new pre-commit script has been added to the Scripts directory that automatically formats staged Swift files using swiftformat. The script checks for the presence of the swiftformat command and installs a reminder if it is missing, then iterates through staged .swift files to apply formatting and stage the results.

Scripts · high confidence

Example app now supports iPad split view and modern scene lifecycle

The Example app has been updated to use the modern UIScene lifecycle (SceneDelegate) and now displays a split-view interface on iPad devices, while maintaining a standard navigation layout on other form factors. This change also includes an initial setup in the AppDelegate to enable text messages on first launch.

Example/Sources · high confidence

Example project workspace relocated and renamed

The example project has been moved from the root-level MessageKit.xcodeproj to the Example/ChatExample.xcodeproj directory. The workspace configuration has been updated to reflect this new location, ensuring the IDE correctly references the project files in their new path.

Example/ChatExample.xcodeproj/project.xcworkspace · high confidence

Extracted BasicAudioController to Example project

The BasicAudioController, previously part of the MessageKit framework, is now available as a standalone file within the Example project. This change allows users to inspect, modify, or replace the audio playback logic (play, pause, stop, and UI updates) directly in their example code without relying on the framework's internal implementation.

Example/Sources/AudioController · high confidence

Refactored extension utilities and standardized asset access

The framework's extension utilities have been reorganized and standardized to improve code clarity and asset management. Internal static colors are now loaded from dedicated color assets via a centralized \Bundle\ extension, ensuring consistent theming and dark mode support. The \NSAttributedString\ extension now uses \.usesFontLeading\ in its bounding rect calculations to fix line height inaccuracies with certain fonts. Additionally, layout helper extensions for \UIView\ and \CGRect\ have been added to simplify Auto Layout constraints, and the \MessageKind\ extension now explicitly handles link preview text extraction.

Sources/Extensions · high confidence

Swift 6 concurrency enforcement and tooling overhaul

The library now requires Swift 6 and enforces strict concurrency checking by annotating \MessageCellDelegate\ and \MessageLabelDelegate\ with \@MainActor\, which is a breaking change for consumers building in Swift 6 mode. The project has dropped CocoaPods support, removed legacy iOS 12 compatibility shims, and migrated its CI and linting tooling from Ruby-based Danger and SwiftPM plugins to Danger Swift and local SwiftFormat/SwiftLint configurations. Additionally, the example app has been updated to adopt the scene lifecycle and build in Swift 6 mode.

(repo-wide) · high confidence

Updated ChatExample Xcode scheme for Xcode 12 and UI testing

The ChatExample project scheme has been updated to target Xcode 12 (LastUpgradeVersion 1200) and now includes a dedicated scheme for ChatExampleUITests. The main scheme's build and launch actions have been reconfigured to target the ChatExample.app instead of the MessageKit framework, and code coverage is now enabled for tests.

Example/ChatExample.xcodeproj/xcshareddata · high confidence

Test coverage

Add basic UI smoke tests for the example app; Added layout calculator tests for message types; Added test for random message type fallback behavior; Added test mocks and harness for cell size calculators; Added unit tests for MessageKit controllers and protocols; Added unit tests for MessageKit model components; Added unit tests for message view components; Removed placeholder test file from MessageKitTests.

Dependencies

MessageKit now requires InputBarAccessoryView 7.0+ and targets iOS 14 with Swift 6

The Swift Package Manager manifest has been updated to declare a dependency on InputBarAccessoryView version 7.0.0 or higher, meaning users must have this updated library available in their projects. Additionally, the package now specifies a minimum deployment target of iOS 14 and enforces Swift 6 language mode, which may require updating existing projects to meet these minimum version requirements.

(dependencies) · high confidence

Housekeeping

Added IDE workspace checks configuration

The example project now includes an IDEWorkspaceChecks.plist file to ensure consistent workspace settings across development environments.

Example/ChatExample.xcworkspace/xcshareddata · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 67 → 63 (-3.1)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 97 → 97 (-0.0)
  • Architecture 92 → 86 (-6.8)
  • Maturity 56 → 56 (-0.4)
  • Readiness 58 → 54 (-4.3)
  • Security 87 → 88 (+1.0)

Resolved (2)

  • Documentation: no usage examples (README.md)
  • Off-boarding risk: anonymized user #1

New (8)

  • Coverage not measured — Swift suite
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • Duplicated block (9 lines × 3) (Sources/Views/TypingBubble.swift)
  • Inconsistent state management for typing indicators. The ViewController exposes a complex method setTypingIndicatorViewHidden with animation and completion blocks, while the CollectionView only exposes a simple boolean property isTypingIndicatorHidden. It is unclear if setting the property on the CollectionView triggers the same animation/state logic as the ViewController method, or if they are disconnected.
  • Medium: security finding (details withheld)
  • Off-boarding risk: anonymized user #1
  • Projects may be oversized for their cohesion
  • Redundant scrolling operations with overlapping intent. scrollToBottom is a specific case of scrollToLastItem (typically with ScrollPosition.bottom). Having both creates confusion about which to use for a simple 'go to bottom' action.

Changes since last survey

  • 15 commits — 10 feature/other, 5 fixes

By area

  • (repo) — 10 commits
  • Tests/MessageKitTests — 3 commits
  • (root) — 1 commit
  • .github/workflows — 1 commit

Notable commits

  • fix: Fix CI in link preview calculator tests
  • fix: Fix the SwiftFormat indent error in the link preview tests
  • fix: Merge pull request #1921 from MessageKit/fix/typing-indicator-sections
  • fix: Merge pull request #1923 from MessageKit/fix/swiftui-input-bar-safe-area
  • fix: Merge remote-tracking branch 'origin/main' into fix/typing-indicator-sections
  • change: Build Danger Swift from source to get libDanger
  • change: Document how to set the zoom level of location messages
  • change: Merge branch 'main' into test/size-calculators
  • change: Merge pull request #1919 from MessageKit/test/size-calculators
  • change: Merge pull request #1920 from MessageKit/chore/normalize-copyright-headers
  • change: Merge pull request #1922 from MessageKit/feature/number-of-message-sections
  • change: Merge pull request #1924 from martinpucik/claude/dreamy-keller-033swv
  • change: Merge remote-tracking branch 'origin/main' into chore/normalize-copyright-headers
  • change: Merge remote-tracking branch 'origin/main' into claude/dreamy-keller-033swv
  • change: Strengthen calculator tests from review feedback

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

MessageKit/MessageKit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit fc924c0a8bd0e5716c3c32f7aa1ddbb99b118535 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.