♻️ Add @MainActor to AddressMapViewDelegate - #1454
Merged
Merged
Conversation
AddressMapView is a UIView subclass (implicitly @mainactor) and every delegate call site runs on the main actor. Annotating the protocol @mainactor reflects that reality and lets @MainActor-isolated conformers (e.g. AddressViewController in finn/ios-app) conform without @preconcurrency, part of the Swift 6 strict concurrency migration (finn/ios-app#10447). The sole conformer in this repo (AddressMapDemoView, a UIView subclass) is already main-actor isolated, so no conformance changes are required.
robinsalehjan
approved these changes
Jul 24, 2026
starv
added a commit
that referenced
this pull request
Jul 30, 2026
…fig statics nonisolated(unsafe) (#1455) Both changes let consumers drop @preconcurrency escape hatches when building under the StrictConcurrency upcoming feature flag. AdRecommendationsGridViewDataSource traffics exclusively in UICollectionView, UICollectionViewCell and IndexPath, and every call site is inside AdRecommendationsGridView (a UIView), so it is already main-actor in practice. Follows the same pattern as #1454. Config.imageProvider and Config.isDynamicTypeEnabled are set once during app startup and read-only afterwards, so nonisolated(unsafe) describes the existing contract without changing any call site.
starv
added a commit
that referenced
this pull request
Aug 5, 2026
…#1456) HappinessRatingView and TextView are UIView subclasses (implicitly @mainactor) and every delegate call site runs on the main actor — TextView's five callbacks are all invoked from UITextViewDelegate, which the SDK already isolates. Annotating the protocols @mainactor reflects that reality and lets @MainActor-isolated conformers (HappinessRatingViewController and TextInputFeedbackViewController in finn/ios-app's Feedback module) conform without @preconcurrency, part of the Swift 6 strict concurrency migration (finn/ios-app#10447). Follows the same pattern as #1454/#1455. All conformers in this repo are UIView subclasses and therefore already main-actor isolated, so no conformance changes are required: HappinessRatingDemoView, FavoriteAdCommentInputView, AdReporterView and TextViewDemoView. TextViewDelegate's default implementations inherit the protocol's isolation and need no annotation. Also annotates the private RatingViewDelegate, which HappinessRatingView already satisfies with main-actor-isolated methods — free to fix now, and it would otherwise warn once FinniversKit itself enables StrictConcurrency.
starv
added a commit
that referenced
this pull request
Aug 7, 2026
…irmationViewDelegate (#1457) 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
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.
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 free
to 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.
Why?
Part of the Swift 6 strict concurrency migration of the NMP iOS codebase's
app-modules/targets (finn/ios-app#10447).AddressMapViewDelegatecarries no isolation, so a@MainActor-isolated consumer in ios-app(
AddressViewControllerin the Maps module) can only conform to it with@preconcurrency, which leaves a residual warning that can't be resolved downstream.Same idea as #1453 (
@Sendableon image-loading handlers), applied to a delegate protocol, and also in response to Robin's reply on PR #10537 in the iOS-app repo.What?
Annotates
AddressMapViewDelegateas@MainActor.This is sound because
AddressMapViewis aUIViewsubclass (implicitly@MainActor) and every delegate call site already runs on the main actor. The annotation just makes the type system reflect where the protocol is actually used.The only conformer in this repo —
AddressMapDemoView— is already aUIViewsubclass (implicitly@MainActor), so no conformance changes are needed. TheFullscreenViewTestssnapshot test is already@MainActorand is unaffected.Verified downstream by building FINN NMP against a local FinniversKit checkout with this change:
AddressViewControllerconforms cleanly with its@preconcurrencyremoved, and nothing else in the app regresses.Version Change
Patch: additive isolation annotation, no runtime behavior change.
@MainActoron a delegate protocol is technically source-breaking for any conformer in a nonisolated context, but the only conformer (internal demo) is already main-actor isolated.UI Changes
None.