SwiftUI: Universal Hero Effect | iOS 16 & iOS 17 | Xcode
🕑 Added 2024-02-01 17:58:23 +0000 UTCSource Code For SwiftUI: Universal Hero Effect | iOS 16 & iOS 17 | Xcode.
Download Code 👇
Comments
Jenya Lebid
Hello, any idea why the source view sometimes flickers before beginning its animation to move to destination view? Its seems to be random. Quickly disappear and then reappear again, then its starts its movement animation. Also seems to only occur on going into destination, not returning back. Thank you!
Huseyin Kocaman
Hello You should use your view inside HeroWrapper. Thats why preview crash. Preview Crash Solution Replace your ContentView with: struct ContentView: View { var body: some View { HeroWrapper { /// to Prevent Preview Crash NavigationStack { List { NavigationLink { Animation1() .navigationTitle("Effect 1") } label: { Text("Animation 1") } NavigationLink { Animation2() .navigationTitle("Effect 2") } label: { Text("Animation 2") } } .navigationTitle("Hero Effect") } } // to Prevent Preview Crash } }
Martin
Hi there! Great tutorial. I'm wondering about the reason for disabling swipe to dismiss and other native navigation interactions.
yasin
Preview Crashed
Spark
Hi there, I'm getting an error: "'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead." in HeroWrapper > addOverlayWindow(). My app is targetting iOS 16.4. Any idea how to fix this, please?
Sergio Udalov
many thanks for iOS 16 support ) it will be great to get iOS 15 is your videos too :D