ekazaev / route-composer

Protocol oriented, Cocoa UI abstractions based library that helps to handle view controllers composition, navigation and deep linking tasks in the iOS application. Can be used as the universal replacement for the Coordinator pattern.
MIT License
896 stars 63 forks source link

Is it easy to use for large SwiftUI-only project now? #101

Closed ibaikaa closed 11 months ago

ibaikaa commented 11 months ago

Hello!

Just found your library. Great job! It is really useful for large UIKit projects.

I am curious if it is as useful for SwiftUI projects?

Learned the example project and found out that I have to wrap all my views into UIHostingController in case to make navigation, which is sad ;(

I am starting a new big SwiftUI B2C Project, and I really liked this library. However, I was not happy with the usage as in the example, because I was confused with some things, such as:

Please correct me if I am wrong (I hope so).

I am really looking forward to know your opinion about using RouteComposer in big SwiftUI Projects and get help for my questions.

I really want to use it, because I am tired of using awkward tools for routing and navigating, such as coordinators, that do not support deep linking, or even worse, native navigation (especially in SwiftUI).

Thank you for your answer! Looking forward to it ;)

ekazaev commented 11 months ago

Hi @ibaikaa

Thank you for your question.

This library is used in a variety of big projects by myself and other people. So it is reliable from that point of view. However I don't know anybody who used it with a pure swift ui projects. So I cant say anything about it. It is not adapted to replace the SwiftUI navigation and I have doubts if Apple itself has a final vision where it wants to go with the navigation in SwiftUI in the future (remembering that they completely changed concept of the navigation in the SwiftUI a few years ago). If you are ready to bet on SwiftUI to start a big project I consider you a brave guy tbh. Apple manages to break SwiftUI even in the minor IOS updates, so here I can only wish you luck :) I wouldn't touch SwiftUI for something bigger than the task list app. But some simple screens can be definitely implemented in SwiftUI in its current state as it seriously speeds up the implementation usually and doesn't have the amount of boilerplate code the UIKit does.

Regarding your questions:

All SwiftUI Views have to be wrapped into UIHostingControllerWithContextFinder()

  • Yes. As they must to be eligible to participate in usual UIKit navigation stack. You can implement variation of this Finder according to your needs if its required.

Did not get it how to use it with TabBar navigation.

  • Come with the example what you want to do and Ill try to explain you how to implement it. It is hard to go through the entire theory otherwise. But usually RouteComposer can easily swithc tabs for you in a way that you dont have to worry about it.

Also, tbh, I worry, that if no one did not check RouteComposer in large SUI Projects and I will be first, I might get some unexpected bugs.

  • I hope I answered that question above.

Best of luck.