Skip to content
CAI
Software that uses CAICheck a score

airbnb/MagazineLayout

65.5

Adequate · 30 September 2026

5.7k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

MagazineLayout is a UICollectionViewLayout subclass for iOS and tvOS that enables vertically scrolling grids and lists with customizable item widths based on fractions. It supports advanced layout features including pinned headers and footers, section insets, and bottom-to-top scrolling for chat-like interfaces. The system handles self-sizing items, customizable insert/delete animations, and ensures pixel-aligned precision for stable scrolling performance.

Features

Add tvOS example app

The MagazineLayout example project now includes a dedicated tvOS target (MagazineLayoutExampleAppleTV), allowing users to build and run the layout demonstration on Apple TV devices alongside the existing iOS app.

Example/MagazineLayoutExample.xcodeproj · high confidence

MagazineLayout now supports section footers, allowing users to define footer height modes and pinning behavior via the new FooterModel. The layout engine's state management has been refactored into a dedicated LayoutState struct, which improves scrolling stability by using settled item heights to calculate target content offsets. Additionally, internal model IDs have been migrated from UUID strings to UInt64 values generated by an IDGenerator to reduce overhead, and the batch update logic has been simplified by removing the explicit BatchUpdateStage enum in favor of direct state access.

MagazineLayout/LayoutCore · high confidence

Initial public release of MagazineLayout

This release introduces MagazineLayout, a UICollectionViewLayout subclass for vertically scrolling grids and lists, featuring item widths based on width fractions, self-sizing in the vertical dimension, customizable insert/delete animations, and support for pinned headers/footers and section backgrounds. The library is now available via Swift Package Manager, Carthage, and CocoaPods, with an example app provided to demonstrate usage and configuration.

(repo-wide) · high confidence

The MagazineLayout now supports section footers, allowing delegates to define their visibility and layout metrics via the new \visibilityModeForFooterInSectionAtIndex\ method. Section layout has been refined with configurable \insetsForSectionAtIndex\ to control spacing relative to content bounds, and \insetsForItemsAtIndex\ for item-level spacing. Additionally, developers can now customize the initial visual state of items during insertions using \initialLayoutAttributesForInsertedItemAt\, enabling tailored entry animations. The layout also introduces a \verticalLayoutDirection\ property to control scroll-position preservation behavior during updates and bounds changes.

MagazineLayout/Public · high confidence

New MagazineLayoutExample sample project

Added a new iOS example application that demonstrates the MagazineLayout library through four distinct demo views: a Grid Layout showcasing various item width modes, a List Layout with section headers and footers, a Message Thread view with bottom-to-top scrolling, and a Performance view handling 100,000 items. The project includes the necessary Xcode workspace, app delegate, scene delegate, and asset catalogs to run these interactive examples.

Example/MagazineLayoutExample · high confidence

Behavioural changes

Added performance instrumentation and documented UIKit sizing bug

Performance monitoring via OS signposts has been added to the \preferredLayoutAttributesFitting\ methods in both \MagazineLayoutCollectionReusableView\ and \MagazineLayoutCollectionViewCell\, allowing developers to trace layout calculation overhead. Additionally, a known UIKit bug causing incorrect cell sizing during bounds changes (such as rotation) has been documented with a link to the associated Apple Radar, clarifying the context for the existing workaround that updates \contentView.bounds\.

MagazineLayout/Public/Views · high confidence

MagazineLayout now supports section footers with configurable visibility and height modes (static or dynamic), including an option to pin headers and footers to the visible bounds. The layout respects safe area insets for fractional-width items on iOS 11+, and dynamic item heights now require an explicit estimated height to improve layout accuracy. Additionally, a new vertical layout direction enum allows for bottom-to-top scrolling (useful for chat interfaces), and several public types have been made Hashable to simplify state management.

MagazineLayout/Public/Types · high confidence

MagazineLayout core types: safer indexing, pixel alignment, and section inset support

The layout engine's core types have been updated to improve stability and precision. \ElementLocation\ now safely handles non-standard index paths to prevent crashes, and \MagazineLayoutSectionMetrics\ introduces per-section insets and uses the display scale for pixel-aligned calculations. New utility types include \Array+SafeSubscript\ for bounds-checked access, \RowOffsetTracker\ for efficient row offset management, \ScreenPixelAlignment\ for precise CGFloat comparisons, and \TargetContentOffsetAnchor\ to define scroll anchoring behavior.

MagazineLayout/LayoutCore/Types · high confidence

MagazineLayout project upgraded to Xcode 13.2 and expanded with new layout features and tests

The MagazineLayout project configuration has been upgraded to Xcode 13.2 (LastUpgradeCheck 1320, LastUpgradeVersion 1330), including Swift migration settings. This update integrates several new source files into the build: \LayoutState.swift\ and \FooterModel.swift\ for layout state and footer support; \MagazineLayoutVerticalLayoutDirection.swift\ and \TargetContentOffsetAnchor.swift\ for vertical layout direction and content offset anchoring; \MagazineLayoutFooterVisibilityMode.swift\ for footer visibility configuration; and utility files like \IDGenerator.swift\, \Array+SafeSubscript.swift\, \Signposting.swift\, \ScreenPixelAlignment.swift\, and \UITraitCollection+DisplayScale.swift\. The project also adds corresponding test files (\LayoutStateTargetContentOffsetTests.swift\, \RowOffsetTrackerTests.swift\, \ScreenPixelAlignmentTests.swift\, \ContentInsetAdjustingContentOffsetTests.swift\) and updates the build scheme to reflect these changes.

MagazineLayout.xcodeproj · high confidence

Test coverage

Added tests for MagazineLayout content offset, layout state, and model updates

Added new test suites for \ContentInsetAdjustingContentOffsetTests\ and \LayoutStateTargetContentOffsetTests\ to verify content offset adjustments and target anchor calculations for both top-to-bottom and bottom-to-top layouts. Updated existing tests in \ModelStateLayoutTests\, \ModelStateUpdateTests\, and \ModelStateEmptySectionLayoutTests\ to reflect API changes, including the introduction of \idGenerator\ for item and section models, the addition of \footerModel\ support, and the migration from \.afterUpdates\/\.beforeUpdates\ state queries to direct property access on \ModelState\.

Tests · high confidence

Dependencies

Add CocoaPods and Swift Package Manager support for MagazineLayout 1.7.0

MagazineLayout is now available via CocoaPods and the Swift Package Manager, allowing users to integrate the library into their iOS and tvOS projects (deployment target 12.0+) using standard dependency managers. The package is configured to support app extensions and targets Swift 5.

(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 62 → 66 (+3.9)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 92 → 92 (-0.3)
  • Architecture 60 → 90 (+30.2)
  • Maturity 60 → 60 (+0.0)
  • Readiness 53 → 56 (+3.7)
  • Security 100 → 100 (+0.0)
  • Performance 79 (new)

Resolved (3)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Hotspot: MagazineLayout/Public/MagazineLayout.swift (MagazineLayout/Public/MagazineLayout.swift)

New (4)

  • Coverage not measured — Swift suite
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • LayoutState.targetContentOffsetAnchor (cognitive 21) (MagazineLayout/LayoutCore/LayoutState.swift)
  • LayoutState.targetContentOffsetAnchor (cyclomatic 22) (MagazineLayout/LayoutCore/LayoutState.swift)

Changes since last survey

  • 2 commits — 1 feature/other, 1 fixes

By area

  • MagazineLayout/LayoutCore — 1 commit
  • MagazineLayout/Public — 1 commit

Notable commits

  • fix: Fix wasted work when using bottomToTop layout (#167)
  • change: Prevent negative item widths when available space is exhausted (#168)

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/MagazineLayout 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 a45a664a68ee81f3961416615ef738d72b99e02f — 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.