SamuKata
kavsoft
kavsoft

patreon


SwiftUI 3.0 Animation Challenge - App Store Shared Element Transition - Xcode 13 - SwiftUI Tutorials

Source Code For SwiftUI 3.0 Animation Challenge - App Store Shared Element Transition - Xcode 13 - SwiftUI Tutorials.


Download Code 👇

SwiftUI 3.0 Animation Challenge - App Store Shared Element Transition - Xcode 13 - SwiftUI Tutorials

Comments

Does anyone have a solution to this? I've checked other "App Store" project and it seem to work fine when the source view is hidden. But I can't seem to resolve why this one doesn't. I would really appreciate it, if anyone has an answer for this.

Alp Avanoğlu

Why .transition(.identity) is needed? what does it do?

Lory Huz

Is there a way to drag to dismiss away the detail view just like the in app store?

Joaquin Alori

May I ask how you accomplished this without losing the animation when opening and closing the detail view?

favinhio

Hey, I get two errors displayed. One is in ContenView, it says Cannot find Home in score. The other one is a bit tricky. At the beginning the scrolling works without problems, but when I open and close an item, I can "drag" the bottom item over the first one. Is it me or is there something missing?

Marsch

I just wanted to point that out, the example you provided are excellent and nicely executed, very nice.

conny håkansson

Yes, but you need to hide it to use both as source. But you are right on the rest of it, I solved that by changing the source alternating with showDetailsPage, and setting the opacity to be almost transparent (0.01), then you will keep the smooth animation and not violating the matchedgeometryeffect. The problem with having both as source will manifest for instance if you use more than one namespace, bring the code in the background and bring it back again, or move to a different view in the graph and then back, if you scroll or do any update in the details view you get unknown experience, in my case it losses the matched position, and restores it, moving the card view to its original position.

conny håkansson

In my MatchedGeometry Videos I showed and explained that you need to hide the source view when pushing the detail but SwiftUI will not translate the animation smoothly when hiding the source view.(Hopping that it will be get cleared on WWDC 22). So if they need smooth animation then keeping the source view is a good choice. Note: You need to build the view that doesn’t affect the detail view when the source view is not hidden. This project is built like that, you can verify that both source and detail view will work properly and animates smoothly .

Kavsoft

This is not a correct way of using MatchedGeometryEffect, you're using multiple views with same id as source, that is not allowed. The only usecase for that is a transition where one of them is exiting the graph and the other one is entering. the example will cause the classic Multiple inserted views in matched geometry group Pair(first: 1, second: SwiftUI.Namespace.ID(id: 6)) have `isSource: true`, results are undefined

conny håkansson

Wow! It’s awesome 🤩🙏🏻

David Londoño

Cool lesson... 👍🔥

Andrej

Thanks

Nabil Lanedri

Thanks .. it's very helpful..

Dev M


More Creators