Closed OrynaSemenets closed 1 year ago
It's strange, there used to be a purple warning in the Refresher file on line 218, but now it's gone) But if it appears again, I'll send a screenshot)
12 мая 2023 г., в 17:54, Brian Floersch @.***> написал(а):
Hi @OrynaPanchenko https://github.com/OrynaPanchenko Thanks for the PR.
Can you reproduce the issue this fixes? As far as I can tell introspect methods are always called on the main thread. The customize functions are called here https://github.com/siteline/SwiftUI-Introspect/blob/master/Introspect/UIKitIntrospectionView.swift#L69 which is called by the delegate method updateUIView https://developer.apple.com/documentation/swiftui/uiviewrepresentable/updateuiview(_:context:) that is always on the main actor.
Thanks!
— Reply to this email directly, view it on GitHub https://github.com/gh123man/SwiftUI-Refresher/pull/6#issuecomment-1545871631, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWXU5X6XX2DHVILWD6LJUDXFZFJRANCNFSM6AAAAAAVSJFLA4. You are receiving this because you are subscribed to this thread.
Sounds good thanks!
Chiming in here: I did see a runtime warning, not because it was not on the main thread, but because it was modifying state during a view update. For me it is 100% reproducible. Here's a screenshot. (Sorry to interrupt, I hope this helps, @gh123man, though...)
This patch does make the warning go away for me, for what it's worth.
@rickpasetto Thanks for reporting this. ill take a look.
I have seen the modifying state during a view update
warnings and as I recall, these occur because of some dirty hacks to support iOS 14.
With iOS 14 being largely unused these days, I'm going to drop support soon and hopefully resolve all of these issues in the process. Ill keep this thread updated.
Thanks!
Can anyone repro modifying state during a view update
or action tried to update multiple times per frame
on iOS 16.2
+?
I was playing with the simulators and this only appears on iOS 15
. Seems fixed on iOS 16+. If this is the case, it may be best to leave it as is.
Other than the annoying Xcode warning, I don't think this has any tangible behavior impact.
@gh123man I have reproduced this issue too. ( iOS16.4 / Simulator )
The warning will no longer be output with this PR change.
I have reproduced this issue too (16.4 / 14 Pro / Simulator)
Thanks for the feedback and the PR.
Hi @OrynaPanchenko Thanks for the PR.
Can you reproduce the issue this fixes? As far as I can tell introspect methods are always called on the main thread. The customize functions are called here which is called by the delegate method
updateUIView
that is always on the main actor.Thanks!