-
Notifications
You must be signed in to change notification settings - Fork 228
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
Fix iOS 16 undefined behavior warnings #225
Fix iOS 16 undefined behavior warnings #225
Conversation
Thanks ! Can you run the You can see the README.md about that Demo, it's not hard to run the demo, just using the Or let me check your PR's branch on this week ? |
Oh neat, I had overlooked the demo. Good news is that the |
I'll try to fix the And, I strongly want to drop the iOS 13 support (SwiftUI 1.0), or I have to use another compatibility support for Using |
I would say at this point, no reason to continue supporting iOS 13,
given the current version is 15.6.1, with iOS 16 to be released on Sept
12. Most iOS developers update relatively rapidly.
PJ
…On 2022-09-08 15:38, DreamPiggy wrote:
I'll try to fix the AnimatedImage, for WebImage seems OK here...
And, I strongly want to drop the iOS 13 support (SwiftUI 1.0), or I
have to use another compatibility support for @StateObject, maybe the
https://github.com/shaps80/SwiftUIBackports can help ?
Using @ObservedObject for ImageManager is a wrong design, because it's
acutally not shared and behave like a @State
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you are subscribed to this
thread.Message ID:
***@***.***>
--
PJ
Links:
------
[1]
#225 (comment)
[2]
https://github.com/notifications/unsubscribe-auth/AACRN3CNDMF3LOSFLSXY6P3V5GCXDANCNFSM6AAAAAAQE6MOU4
|
// This solve the case when WebImage created with new URL, but `onAppear` not been called, for example, some transaction indeterminate state, SwiftUI :) | ||
if imageManager.isFirstLoad { | ||
imageManager.load() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply removing this leads to cases where the images are not loaded in our app.
It seems imageManager.load()
can be added to the init()
so this is still called initially, but outside of view updates.
Not quite sure if the isFirstLoad
property would still be needed then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I eventually ran into this too and the fix, restoring the lines to init(), is working for me. PR updated.
} | ||
if self.purgeable { | ||
self.imagePlayer.clearFrameBuffer() | ||
.onAppear { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we should not stick to onPlatformAppear()
? I guess there were cases when the pure SwiftUI onAppear()
was not sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I sure, no, but it seems to be working ok and I'm even less sure of how to keep it and fix the errors. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is buggy on SwiftUI 1.0 (iOS 13) in some area so I write the UIView wrapper to get the similiar behavior. But this should be fixed in SwiftUI 2.0 (iOS 14)
Hi. StatusToday I tried the SwiftUIBackports, change the code to use that and refactor the logic into However, it seems that the SwiftUIBackports provided See comparation in video. The only changes is that SolutionI found no way to support iOS 13's correct behavior without hacking and hacking. I think drop iOS 13 and bump min deployment target to iOS 14 is the correct way to go. |
StatusI use the ugly hack to support both iOS 13 && 14 And I try to fix the AnimatedImage using the So this PR can be replaced with my new PR #227 |
Closing in favor of #227 |
Please have a try with v2.1.0 |
Fixes warnings triggered by bad state updates mentioned in #222
Not tested with AppKit and could use the input of someone familiar with
SwiftUICompatibility.swift
(this removes usage)