shaps80 / SwiftUIBackports

A collection of SwiftUI backports for iOS, macOS, tvOS and watchOS
MIT License
931 stars 59 forks source link

Push Transition #18

Closed drucelweisse closed 1 year ago

drucelweisse commented 1 year ago

Describe your changes

This pr adds a new push transition from SwiftUI 4 lifecycle

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

shaps80 commented 1 year ago

@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

drucelweisse commented 1 year ago

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?

shaps80 commented 1 year ago

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.

drucelweisse commented 1 year ago

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

shaps80 commented 1 year ago

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 commented 1 year ago

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