SwiftUI implementation of Compose Children widget #264
Replies: 2 comments
-
Thanks for he question! This is partially related to #228, where I explained why it's not possible to create and publish a companion Swift library. So the only reasonable way currently is to provide copy-paste solutions. A while ago, before the todo-app example was moved from this repository to compose-jb, I created a RouterView for SwiftUI. While moving the example to another repository, I decided to avoid the RouterVIew for simplicity. The Additionally, at that point of time there was no way in SwiftUI to preserve the UI state while navigating. E.g. the scrolling state was reset when you go back from the List screen to the Main screen. So the I also have little experience with iOS development, so I it would be really good if the community investigated different approaches and provide some feedback! The NavigationStack library looks interesting from the first sight, so worth to check if it can be integrated with Decompose. |
Beta Was this translation helpful? Give feedback.
-
Continuing conversation on the fork |
Beta Was this translation helpful? Give feedback.
-
When using the
Children
widget in Jetpack Compose, it is a lot easier to implement an Android app navigation transitions than iOS. It would be nice to have a SwiftUI equivalent to provide a similar animation api using the Swift UI transition API like in the todo app.The problem currently in the SwiftUI sample would be to add a third page after the edit with another transition sliding in, this causes the edit page to slide out to the right when the third page is coming in from the right. While on Android this animation would have the edit page slide to the left while the new page is coming in from the right.
I'm not really a Swift developer, but was wondering if using a library like NavigationStack could be used to integrate with Decompose's navigation API to perform the transitions based off the states being emitted by the router. Or perhaps do something similar to implementing a native back swipe suggestion with a
ZStack
view that can have minimal logic to handle the transitioning?Beta Was this translation helpful? Give feedback.
All reactions