Skip to content

Conversation

dreampiggy
Copy link
Collaborator

@dreampiggy dreampiggy commented Sep 21, 2022

Changes

  1. Revert back the onPlatformAppear to fix iOS 14+ behavior Use backport for all OSs
  2. ImageManager API changes. The init method has no args, use load(url:options:context:) instead

This PR close #230 close #229 close #228

As for now, Swift still can not use different stored property on different availability check OS Host. This is runtime limit. Previous #227 will cause a Swift runtime crash when demangling symbols from iOS 13+

So, I just remove the SwiftUI.StateObject references and use Backport + PlatformAppear hack (Because SwiftUI.List 's onAppear does not works as expected when using non SwiftUI.StateObject)

v3.0.0 will remove iOS 13 support.

@dreampiggy dreampiggy changed the title Fix iOS 13 compatibility Fix iOS 13 compatibility && State changes Sep 21, 2022
@dreampiggy dreampiggy added this to the 2.1.1 milestone Sep 21, 2022
@dreampiggy dreampiggy force-pushed the fix_backport_ios13 branch 2 times, most recently from a9d546a to 3f31457 Compare September 21, 2022 11:24
@dreampiggy dreampiggy added the API API changes label Sep 21, 2022
@dreampiggy
Copy link
Collaborator Author

The fix behavior for @State binding is OK now, testing using the new Demo

You can change the ContentView2 into ContentView) in ContentView.swift to run

Video:

Screenshot.mov.zip

Using the `StateObject` to check and refresh to the latest status, using `currentURL` and `currentAnimatedImage` to check lazily
Move the reset logic into helper function setupManager
@dreampiggy
Copy link
Collaborator Author

I think the version should bump to v2.2, not v2.1.1 patch, because it seems there are API changes and it's more than a simple bugfix.

@dreampiggy dreampiggy modified the milestones: 2.1.1, 2.2.0 Sep 22, 2022
@dreampiggy
Copy link
Collaborator Author

All tests passed now.

@dreampiggy dreampiggy merged commit 9a82da2 into master Sep 22, 2022
@dreampiggy dreampiggy deleted the fix_backport_ios13 branch September 22, 2022 08:28
@dreampiggy dreampiggy changed the title Fix iOS 13 compatibility && State changes Fix iOS 13 compatibility && WebImage/AnimatedImage using @State to publish changes Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API changes
1 participant