SwiftUIBackports icon indicating copy to clipboard operation
SwiftUIBackports copied to clipboard

Push Transition

Open drucelweisse opened this issue 1 year ago • 4 comments

Describe your changes

This pr adds a new push transition from SwiftUI 4 lifecycle

  • Added func push(from edge: Edge) -> AnyTransition

Question: Is there an example how to add it to Backport?

drucelweisse avatar Aug 10 '22 11:08 drucelweisse

@drucelweisse yep just checkout all existing backports. It's fairly self explanatory. We will need to test carefully to ensure it behaves identically to iOS 16 version (and other platforms) but the actual implementation you can workout from existing back ports

shaps80 avatar Aug 11 '22 09:08 shaps80

Yeah, I think that I got it, only current problem that AnyTransition doesn't have public init, and I'd like to use something like this:

Text("some text").transition(.backport.push(from: .top))

Is it ok to use identity for backport value?

drucelweisse avatar Aug 11 '22 18:08 drucelweisse

Yeah, I think that I got it, only current problem that AnyTransition doesn't have public init, and I'd like to use something like this:

Text("some text").transition(.backport.push(from: .top))

Is it ok to use identity for backport value?

I think that's the right way to do it, as long as it behaves correctly I don't see an issue here.

shaps80 avatar Aug 12 '22 09:08 shaps80

Currently I don't have an iOS 16 on my device nor Xcode 14, so I don't know how to test it correctly. You can checkout Kavsoft video as reference. And my video where I added transition to demo app

https://user-images.githubusercontent.com/36012972/184420686-7534ff6b-fa60-48e4-a002-74f50088ca77.mp4

drucelweisse avatar Aug 12 '22 18:08 drucelweisse

Ok got it! @drucelweisse amazing work thank you. I will check this out and just ensure it behaves correctly, then I'll get this included soon-ish. Thanks for your contribution 👍

shaps80 avatar Aug 15 '22 09:08 shaps80

Merging as this looks great, I'll get it into the next release, thanks again!

shaps80 avatar Aug 16 '22 08:08 shaps80