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

View dependend protocols should be marked with @MainActor #1389

Open
BastianKusserow opened this issue Nov 8, 2023 · 2 comments
Open

View dependend protocols should be marked with @MainActor #1389

BastianKusserow opened this issue Nov 8, 2023 · 2 comments

Comments

@BastianKusserow
Copy link

(Required) Version Number: 8.0.5

Description

I've got a ViewController that conforms to the JTACMonthViewDelegate protocol. With strict concurrency warnings turned on, the compiler complains that "Main-actor isolated instance method cannot be used to satisfy nonisolated protocol requirement` since the ViewController is obviously marked @mainactor. I think all the view dependent delegate protocols (and probably also the data source protocols) should be marked @mainactor, since they are probably called from the main actor anyways. This is also how UICollectionViewDelegate and DataSources are marked.

Steps To Reproduce

Conform a ViewController to a delegate like JTACMonthViewDelegate with swift strict concurrency warnings set to complete.

Expected Behavior

The compiler shouldn't complain about nonisolated protocol requirements.

@patchthecode
Copy link
Owner

hmmm...
if i put mainactorinto this library, i think this will raise the minimum OS requirement?
if yes, then is there another way around this? I am unfamiliar with mainactor

@BastianKusserow
Copy link
Author

Hmh, might work if we gate this with #if swift(<5.4) or something like that. I can try this out and submit a PR if you want to.

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

No branches or pull requests

2 participants