Skip to content
CAI
Software that uses CAICheck a score

airbnb/HorizonCalendar

78.9

Strong · 30 September 2026

8.4k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

HorizonCalendar is a reusable iOS calendar component library that provides both UIKit and SwiftUI interfaces for displaying and interacting with date ranges. It supports advanced features such as multi-day selection, horizontal pagination, and customizable day and month views, while ensuring accessibility and performance through a model-based rendering engine. The system allows developers to integrate calendar functionality into their apps with flexible layout options and programmatic control over scrolling and visible ranges.

Features

New public item views and SwiftUI integration for calendar components

The \Sources/Public/ItemViews\ module now exposes several new public UIKit views for calendar customization: \DayOfWeekView\ for day headers, \DayView\ for individual day cells (including touch feedback and pointer interaction support), \MonthHeaderView\ for month titles, \MonthGridBackgroundView\ for drawing grid separators, and \DrawingConfig\/\Shape\ for styling backgrounds and highlights. Additionally, \SwiftUIWrapperView\ is now public, allowing developers to embed custom SwiftUI views directly into the calendar using \CalendarItemModel\s.

Sources/Public/ItemViews · high confidence

Behavioural changes

2 commits (0 fixes) modifying HorizonCalendar.xcodeproj/project.xcworkspace

A change to existing behaviour in HorizonCalendar.xcodeproj/project.xcworkspace — 2 commits, 1 file.

Example/HorizonCalendarExample.xcworkspace, HorizonCalendar.xcodeproj/project.xcworkspace · medium confidence · unverified

Added Xcode workspace configuration for Swift Package Manager

A new \contents.xcworkspacedata\ file has been added to the \.swiftpm/xcode/package.xcworkspace\ directory, establishing the standard Xcode workspace structure required for the Swift Package Manager. This change enables the package to be opened and edited directly within Xcode, facilitating local development and integration with SwiftLint as indicated by the commit context.

.swiftpm · medium confidence

Calendar API refactored to use CalendarItemModel and SwiftUI integration

The public API for defining calendar content has been replaced: the old \CalendarItem\ type is removed and replaced by \CalendarItemModel\ and \CalendarItemViewRepresentable\, which separate invariant view properties from dynamic content and support both UIKit and SwiftUI views via new convenience factories (e.g., \calendarItemModel\ on SwiftUI \View\). \CalendarViewContent\ now uses these models for its item providers, and \CalendarView\/\CalendarViewRepresentable\ accept content built with the new types. Additionally, \CalendarViewProxy\ is introduced to allow programmatic scrolling from SwiftUI, exposing \visibleMonthRange\, \visibleDayRange\, \scrollToMonth\, and \scrollToDay\. Date types used in callbacks and contexts are now \DayComponents\/\DayComponentsRange\ and \MonthComponents\/\MonthComponentsRange\, and layout contexts (\DayRangeLayoutContext\, \MonthLayoutContext\, \OverlayLayoutContext\) provide frame and bounds information for custom drawing.

Sources/Public · high confidence

Calendar rendering engine refactored to use a model-based view system with improved accessibility and layout precision

The internal calendar rendering engine has been significantly refactored to decouple view logic from layout data. The core \CalendarItemView\ has been renamed to \ItemView\ and now consumes \CalendarItemModel\ objects instead of direct \CalendarItem\ instances, enabling more efficient content updates and view reuse via the new \ItemViewReuseManager\. Accessibility has been improved by introducing a custom \CalendarScrollView\ that explicitly filters subviews to expose only relevant item views to VoiceOver, and by replacing the previous off-screen accessibility element approach with a simpler \ColorViewRepresentable\ for background items. Layout calculations have been enhanced to support configurable day and day-of-week aspect ratios, precise layout margins, and a double-layout pass mechanism that ensures correct intrinsic content sizing for self-sizing containers. Additionally, z-ordering of subviews is now managed by a dedicated \SubviewInsertionIndexTracker\ to ensure correct visual layering of backgrounds, ranges, and pinned headers.

Sources/Internal · high confidence

Example app adopts CalendarItemViewRepresentable and adds horizontal pagination demos

The HorizonCalendarExample app has been updated to use the new CalendarItemViewRepresentable protocol for its UI components, including DayRangeIndicatorView, TooltipView, and the newly added SwiftUIDayView, replacing the previous UIKit-only DayView. This refactor introduces proper right-to-left (RTL) support for the day range indicator and enables the use of invariant view properties for better performance. Additionally, the demo picker now supports a horizontal layout mode with paginated scrolling, exposing new demo scenarios such as Partial Month Visibility, Month Grid Background, and SwiftUI item models, while the Info.plist has been updated to support all interface orientations and disable minimum frame duration on iPhone.

Example/HorizonCalendarExample/HorizonCalendarExample · high confidence

Example project updates: new demos, iOS 16 target, and team ID change

The HorizonCalendarExample project has been updated to target iOS 16.0 (up from iOS 11.0/13.5) and switched to a new development team (C835JB7RUE). Several new demo view controllers and supporting files have been added to the example app, including PartialMonthVisibilityDemoViewController, MonthBackgroundDemoViewController, SwiftUIItemModelsDemoViewController, SwiftUIScreenDemoViewController, DayRangeSelectionTracker, and SwiftUIDayView, while the legacy DayView.swift has been removed.

Example/HorizonCalendarExample/HorizonCalendarExample.xcodeproj · high confidence

HorizonCalendar 2.0.0 release with SwiftUI support and accessibility improvements

This entry documents the HorizonCalendar 2.0.0 release, which introduces a \CalendarViewRepresentable\ for native SwiftUI integration alongside the existing UIKit \CalendarView\. The update includes significant performance enhancements, such as a 35% improvement in scroll performance for SwiftUI views and a 15% reduction in CPU usage during rapid scrolling. Accessibility has been rewritten to improve VoiceOver performance and fix focus bugs, while the public API was simplified by removing deprecated code, renaming \viewModel\ to \content\, and updating \monthDayInsets\ to use \NSDirectionalEdgeInsets\. New features include animated content updates, multi-day selection via drag gestures, self-sizing month headers, and customizable day-of-the-week aspect ratios.

(repo-wide) · high confidence

Project structure reorganization and Xcode 12 upgrade

The HorizonCalendar project has been upgraded to Xcode 12 (LastUpgradeVersion 1200) and restructured to support new capabilities. Several core types have been renamed to simplify the API: CalendarItemView, VisibleCalendarItem, and CalendarItemViewReuseManager are now ItemView, VisibleItem, and ItemViewReuseManager, while CalendarItem is now CalendarItemModel. The project now includes new source files for SwiftUI integration (CalendarViewRepresentable, CalendarViewProxy, SwiftUIWrapperView), layout contexts (OverlayLayoutContext, MonthLayoutContext, DayRangeLayoutContext), and UI components (MonthGridBackgroundView, DaysOfTheWeekRowSeparatorOptions). Documentation files (CHANGELOG.md, CONTRIBUTING.md, TECHNICAL\_DETAILS.md) and new test files (ItemViewReuseManagerTests, SubviewsManagerTests, etc.) have been added to the project structure.

HorizonCalendar.xcodeproj · high confidence

Refactor demo app to use simplified CalendarViewContent API and BaseDemoViewController

The example project's demo view controllers have been refactored to adopt the simplified \CalendarViewContent\ builder API (replacing the older \with\*\ methods and manual \CalendarItem\ construction) and to inherit from a new \BaseDemoViewController\. This base class centralizes the \CalendarView\ setup, layout constraints, and common utilities, allowing individual demo controllers to focus solely on their specific content configuration. The diff also introduces new demo screens for month grid backgrounds, partial month visibility, and SwiftUI-based day/month views, demonstrating the updated API surface.

Example/HorizonCalendarExample/HorizonCalendarExample/Demo View Controllers · high confidence

Test coverage

Added unit tests for HorizonCalendar core components

Added comprehensive test coverage for the HorizonCalendar library, including new test suites for CalendarContent (verifying nil closure handling and default value fallbacks), CalendarScrollView (validating accessibility element filtering), HorizontalMonthsLayoutOptions (confirming width calculations), ItemViewReuseManager (testing view creation and reuse logic), PaginationHelpers (ensuring correct page offset and index calculations), SubviewsManager (verifying subview insertion ordering), and FrameProvider (checking layout frames and day sizes). Existing tests for DayHelper, DayOfWeekPosition, and LayoutItemTypeEnumerator were also updated to use modern XCTest APIs and reflect API changes.

Tests · high confidence

Dependencies

HorizonCalendar 2.0.0: iOS 12+ support, Swift 5.9, and new dependency

HorizonCalendar has been updated to version 2.0.0, raising the minimum iOS deployment target from 11.0 to 12.0 and the Swift language version from 5.1 to 5.9. The package now includes a dependency on the \airbnb/swift\ package (version 1.2.0) and updates its source path to \Sources\. This release also introduces several new capabilities, including animated content updates, pagination for horizontal calendars, self-sizing month headers, and support for specifying custom views for month and day background decorations, multi-day selection via drag gestures, pinning the days-of-the-week row, showing partial boundary months, and right-to-left layout support.

(dependencies) · 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

Score

  • CAI 77 → 79 (+1.6)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 95 → 95 (-0.1)
  • Architecture 96 → 99 (+3.4)
  • Maturity 75 → 75 (+0.0)
  • Readiness 67 → 71 (+3.9)
  • Security 100 → 100 (+0.0)

New (6)

  • Coverage not measured — Swift suite
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (8 lines × 2) (Sources/Public/DayRange.swift)
  • Inconsistent naming convention for SwiftUI view customization. Some methods use the plural noun form indicating the element being customized (e.g., days, dayBackgrounds, monthHeaders), while others use the singular noun form indicating the provider mechanism (e.g., dayItemProvider, monthHeaderItemProvider). This creates two parallel APIs for the same intent: one returning a CalendarViewRepresentable/Self directly, and another returning a CalendarViewContent builder. While technically distinct return types, the naming days vs dayItemProvider is confusingly similar in intent but different in signature and return type, forcing users to choose between two similarly-named but structurally different methods.
  • Inconsistent naming for the same UI event. The UIKit CalendarView exposes the event as didEndDragging, while the SwiftUI wrapper CalendarViewRepresentable exposes it as onDragEnd. While onDragEnd is more idiomatic for SwiftUI, the discrepancy with the underlying UIKit property name (didEndDragging) creates confusion about whether these are the same event or different ones, especially since the signatures are identical.

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

Survey your own repository

airbnb/HorizonCalendar 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 257927434aecbc4a70163570b5ef40976f0428a2 — 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.