coordinator-pattern

SwiftUI MVVM Coordinator/Router/NavigationLink

自闭症网瘾萝莉.ら 提交于 2020-04-16 05:49:33
问题 I am having problems to translate UIKit architecture patterns to SwiftUI. My current pattern is mostly MVVM with Coordinators/Routers. The MVVM part seems quite easy and natural with the addition of @ObservableObject/@Published. But the coordinating/routing seems unintuitive. The View and the coordination (navigation) functionality are tightly coupled in SwiftUI. It seems like it's not really possible to separate them apart from using the helper struct AnyView . Here one example: I want to

SwiftUI MVVM Coordinator/Router/NavigationLink

别等时光非礼了梦想. 提交于 2020-04-16 05:49:30
问题 I am having problems to translate UIKit architecture patterns to SwiftUI. My current pattern is mostly MVVM with Coordinators/Routers. The MVVM part seems quite easy and natural with the addition of @ObservableObject/@Published. But the coordinating/routing seems unintuitive. The View and the coordination (navigation) functionality are tightly coupled in SwiftUI. It seems like it's not really possible to separate them apart from using the helper struct AnyView . Here one example: I want to

Back button not being called in TabbarCoordinator in horizontal flow iOS 12

血红的双手。 提交于 2020-01-16 10:11:48
问题 Coordinator pattern is an old topic with many libraries trying to solve it and I am learning it in simple example app. My current set up is 3 rootViewControlers: LoadingStateCoordinator , WelcomeCoordinator , TabBarCoordinator but missing connection between UIKit and coordinators. I am trying to implement it with a UINavigationController but the button is not being called. I need a way to connect to back button and a reusable coordinator that I could push to and dellocate accordingly (that is