Skip to content

Annotate UIKit-bound controllers with @MainActor for Swift 6 - #103

Open
Xopoko wants to merge 1 commit into
gaetanzanella:mainfrom
Xopoko:swift-6.2-mainactor
Open

Annotate UIKit-bound controllers with @MainActor for Swift 6#103
Xopoko wants to merge 1 commit into
gaetanzanella:mainfrom
Xopoko:swift-6.2-mainactor

Conversation

@Xopoko

@Xopoko Xopoko commented Dec 10, 2025

Copy link
Copy Markdown

Summary

  • mark UIKit-facing helper extensions and controllers as @MainActor
  • fixes Swift 6 SWIFT_STRICT_CONCURRENCY=complete builds by allowing constraint updates and animator callbacks on the main actor

Details

Building with Swift 6.2 and SWIFT_SUPPRESS_WARNINGS=NO currently fails due to main-actor isolation violations in:

  • UIViewController+Children.swift (helper methods used by container)
  • HeightContraintOverlayTranslationController.swift (mutates NSLayoutConstraint)
  • InterruptibleAnimatorOverlayContainerTransitionCoordinator.swift (animator callbacks)

Adding @MainActor to these types brings them in line with UIKit’s main-thread requirement and resolves the concurrency errors. Behavior is unchanged; only actor isolation is specified explicitly.

Tested: builds cleanly on Swift 6.2 simulator with strict concurrency.

@Xopoko
Xopoko force-pushed the swift-6.2-mainactor branch from 4516172 to 2cf595b Compare December 10, 2025 08:15
@gaetanzanella

Copy link
Copy Markdown
Owner

Hey @Xopoko thank you for the MR!
Could you add this @mainactor everywhere? 🙏 every component should have it

@Xopoko

Xopoko commented Jul 29, 2026

Copy link
Copy Markdown
Author

Thanks — agreed. I rechecked current head 2cf595be396477f63aa66169847b20120567b3f2; it only annotates three UIKit-bound types, so this remains incomplete. I’m treating the request as actionable and will follow up here with the successor SHA and build/test evidence once the full component set is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants