Skip to content

♻️ Add @MainActor to RadioButtonDelegate, AdReporterDelegate and ConfirmationViewDelegate - #1457

Merged
starv merged 1 commit into
masterfrom
concurrency/ad-reporter-delegates
Aug 7, 2026
Merged

♻️ Add @MainActor to RadioButtonDelegate, AdReporterDelegate and ConfirmationViewDelegate#1457
starv merged 1 commit into
masterfrom
concurrency/ad-reporter-delegates

Conversation

@starv

@starv starv commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Why?

The NMP iOS app is migrating app-modules targets to the StrictConcurrency upcoming feature flag, one module per PR (finn-no/ios-app#10447). The AdReporting module needs three @preconcurrency escape hatches to build cleanly, and all three exist only because of FinniversKit declarations.

This continues the work started in #1453, #1454, #1455 and #1456.

What?

@MainActor on RadioButtonDelegate, AdReporterDelegate and ConfirmationViewDelegate

All three protocols are already main-actor in practice. RadioButton (via Selectionbox), AdReporterView and ConfirmationView are UIView/UIScrollView subclasses and therefore implicitly @MainActor, and every delegate call site is inside them — RadioButton.handleSelecting(_:), AdReporterView's help-button handler, and ConfirmationView's dismiss-button handler. Annotating the protocols makes that explicit so @MainActor conformers no longer warn that the conformance "crosses into main actor-isolated code". Same pattern as #1454, #1455 and #1456.

AdReporterDelegate refines RadioButtonDelegate; it is annotated explicitly rather than relying on inheritance, since a refining protocol's own requirements do not pick up the parent's global actor.

Blast radius is small. The only conformer in this repo is AdReporterDemoView, a UIView subclass that is already main-actor isolated, so it needed no change. Across the NMP app there is exactly one conformer — AdReporterViewController — which is a UIViewController and likewise already isolated.

Version Change

Minor. @MainActor on a public protocol is potentially source-breaking for any nonisolated conformer, though there are none in this repo.

UI Changes

None. Isolation annotations only, no behaviour or layout changes.

Verification

  • Demo scheme builds clean against these changes (Build Succeeded, zero errors), with all three changed sources plus AdReporterDemoView confirmed recompiled rather than served from cache.
  • SwiftLint clean on the changed files.
  • Verified end-to-end from the consumer side: pointing NMP app-modules at this local checkout via .package(path:) and enabling swiftSettings: .strictConcurrency on the AdReporting target builds with zero errors and zero module-owned warnings and no @preconcurrency annotations at all, confirming this change set is sufficient.
  • Full FINN NMP app build and simulator launch against this local checkout: ** BUILD SUCCEEDED **, 0 errors, 0 warnings from AdReporting, app launched successfully. This compiles every downstream vertical (Jobs, Mobility, RealEstate, Recommerce), not just the one module.

…irmationViewDelegate

All three protocols are main-actor in practice: RadioButton, AdReporterView and ConfirmationView are UIView subclasses, and every delegate call site is inside them. Annotating the protocols lets @mainactor conformers satisfy them without the "conformance crosses into main actor-isolated code" warning under StrictConcurrency.

Continues the work in #1453, #1454, #1455 and #1456.
@starv
starv marked this pull request as ready for review August 7, 2026 10:11
@starv
starv requested a review from AndreyMomot August 7, 2026 10:12
@starv
starv merged commit f0984a2 into master Aug 7, 2026
1 check passed
@starv
starv deleted the concurrency/ad-reporter-delegates branch August 7, 2026 11:29
starv added a commit that referenced this pull request Aug 11, 2026
…rizontalSlideTransitionDelegate (#1459)

All three protocols are main-actor in practice: FeedbackView and InfoboxView are UIView subclasses and every delegate call site is inside them, and HorizontalSlideTransition only invokes its delegate from a UIPresentationController callback. Annotating the protocols lets @mainactor conformers satisfy them without the "conformance crosses into main actor-isolated code" warning under StrictConcurrency.

The internal HorizontalSlideControllerDelegate is annotated too, because it is not optional here: HorizontalSlideTransition is a plain NSObject whose HorizontalSlideControllerDelegate witness is what forwards to the now-main-actor HorizontalSlideTransitionDelegate. Isolating only the public protocol would make that forwarding call an error inside FinniversKit. Its only caller is HorizontalSlideController, a UIPresentationController subclass, so it is already on the main actor.

Continues the work in #1453, #1454, #1455, #1456 and #1457.
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