Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply various @MainActor annotations #1446

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nighthawk
Copy link
Contributor

In Xcode 16 View automatically gets @MainActor applied. This breaks creating a custom LVN Addon as the static lookup(_:,element:) is not isolated to the main actor, which the Swift compiler doesn't allow.

I went through the exercise of annotating CustomRegistry as @MainActor and working through the many follow-ups of annotating other things also as @MainActor.

This is now working in my early test cases, but I'm by no means sure that this is the right approach here. Hence, marking this as a draft for now.

@@ -13562,6 +13562,7 @@ case let ._MatchedGeometryEffectModifier(modifier):

let context: ParseableModifierContext

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems auto-generated, so this fix isn't enough as it'd get reverted on the next generation.

@carson-katri
Copy link
Contributor

carson-katri commented Sep 17, 2024

Can you share an example of the code that causes the build issue? I'm assuming you built with the Swift Language Version set to Swift 6

@carson-katri
Copy link
Contributor

In the meantime, you may be able to import LiveViewNative differently to work around this:

@preconcurrency import LiveViewNative

@nighthawk
Copy link
Contributor Author

I indeed had swift-tools-version: 6.0 in my Package.swift which turned on the strict concurrency checks. I've reverted that back to 5.x and that's working fine with version 0.3.0 of LiveView Native.

There wasn't anything special in my package, so the same would happen in other add-on libraries if they switch to the 6.0 language mode.

For reference, this is my add-on package: LiveViewNativeGeoProjector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants