Uh oh!
There was an error while loading. Please reload this page.
Adopt default main actor isolation and drop CocoaPods - #55
Closed
jmarek41 wants to merge 1 commit into
Closed
Conversation
Set `defaultIsolation` to `MainActor` and the Swift 6 language mode for both targets, which makes the whole UIKit-facing API main actor-isolated without a single annotation in the library sources. Platforms move to iOS 15 / tvOS 15 to match FTAPIKit, which makes the `@available(iOS 13.0, tvOS 13.0, *)` annotations redundant. CocoaPods support is removed in favour of the Swift package, so the `#if SWIFT_PACKAGE` guards around `import CellKit` go away too. The Example app is updated to the Swift 6 language mode with default main actor isolation and approachable concurrency, matching how apps consuming CellKit are configured. CI is rewritten to match FTAPIKit: no `pod lib lint`, current runner actions, and a build of both library schemes plus the Example app. The two long-standing SwiftLint violations in DataSource.swift are fixed so `swiftlint --strict` passes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jmarek41
commented
Aug 15, 2026
MemberAuthor
Closing for now — keeping the work on the branch while we settle the approach. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternative to #54.
Motivation
#54 isolates CellKit's UIKit-facing API to the main actor by annotating each declaration with
@MainActor. The goal is right — CellKit is aUITableView/UICollectionViewdata source layer and every one of its protocols is only ever exercised on the main thread — but Swift 6.2 ships a setting built exactly for this (SE-0466), and Apple's WWDC25 guidance points UI-focused modules at it directly.Change
defaultIsolationset toMainActorplus the Swift 6 language mode on both targets:Zero
@MainActorannotations in the library sources. The onlySources/changes are removals: redundant@available(iOS 13.0, tvOS 13.0, *),#if SWIFT_PACKAGEguards, and two long-standing SwiftLint violations.Notably it also needs no rework of
DifferentiableCellModelWrapper— noMainActor.assumeIsolated, no eagerly storeddifferenceIdentifier. Under SE-0470 the wrapper'sEquatable/Differentiableconformances become main actor-isolated and DifferenceKit's nonisolated generic algorithm accepts them, because it is called from the main actor.Other changes:
CellKit.podspec,Gemfile,Gemfile.lock). The podspec could not expressdefaultIsolationwithout duplicating it asSWIFT_DEFAULT_ACTOR_ISOLATIONinpod_target_xcconfig, which would leave two distribution channels able to drift apart on the public concurrency contract.ci.yml: nopod lib lint,actions/checkout@v6, and a build of both library schemes plus the Example app.swiftlint --strictnow passes — it did not onmain.Consumer impact
Verified against a real consumer module compiled in the Swift 6 language mode:
nonisolatedisolationMainActorisolation@MainActoron the conformanceThe first row is the case #54 was written for — the 45 hand-written
@MainActorconformances and the@preconcurrency importall become unnecessary.The second row is a rough edge in conformance isolation inference: it is not inferred through inherited protocol requirements even with
InferIsolatedConformancesenabled. It is not introduced by this PR —mainalready requires an annotation there today. Both cases are documented in the README, and the Example app demonstrates the second.Verification
xcodebuild buildsucceeds forCellKitandDiffableCellKitongeneric/platform=iOSwith zero warnings, in the Swift 6 language mode.UITableViewRowActiondeprecations in its own code).swiftlint --strict: 0 violations.Tested with Xcode 26.6 / Swift 6.3.3.
Breaking
Source-breaking for any conformance that is not main actor-isolated, and the platform floor moves to iOS 15 / tvOS 15 with Xcode 26+ required to build. Warrants a 1.0.0 tag — the README already points at
from: "1.0.0", so that tag needs cutting before this is announced.🤖 Generated with Claude Code