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

Xcode 15.3 concurrency warnings when using Screen.scale #765

Closed
jszumski opened this issue Mar 7, 2024 · 0 comments · Fixed by #766
Closed

Xcode 15.3 concurrency warnings when using Screen.scale #765

jszumski opened this issue Mar 7, 2024 · 0 comments · Fixed by #766

Comments

@jszumski
Copy link
Contributor

jszumski commented Mar 7, 2024

Building with Xcode 15.3 shows 2 new concurrency warnings:

Sources/Nuke/Processing/ImageProcessors+Resize.swift:88:60
Main actor-isolated static property 'scale' can not be referenced from a non-isolated context; this is an error in Swift 6

Sources/Nuke/Internal/Graphics.swift:198:44
Main actor-isolated static property 'scale' can not be referenced from a non-isolated context; this is an error in Swift 6

Screen is indeed marked @MainActor:

@MainActor
enum Screen {
#if os(iOS) || os(tvOS)
    /// Returns the current screen scale.
    static let scale: CGFloat = UIScreen.main.scale
#elseif os(watchOS)
    /// Returns the current screen scale.
    static let scale: CGFloat = WKInterfaceDevice.current().screenScale
#else
    /// Always returns 1.
    static let scale: CGFloat = 1
#endif
}
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 a pull request may close this issue.

1 participant