I want to create model at first in AppCoordinator and don't want to get instance whole project. I don't know if this is the best way but I need my updated model in all the view controllers. This can any data by the way, I want to pass data using XCoordinator.
My code is like below, router is assigning, but model is still nil in VC? Why?
`class AppCoordinator {
var root: Presentable?
private var person: Person
init() {
self.person = Person()
}
func start(in window: UIWindow) {
root = {
if MyUserDefaults.firstLaunch { //Uygulamaya ilk kez giriş yapılmışsa
return GuideCoordinator(model: person)
} else if FirestoreHandler.authUID == nil { //Daha önce giriş yapılmış ancak user authenticated değilse
return AuthCoordinator(model: person)
} else { //Daha önce giriş yapılmışsa ve kullanıcı authenticated ise
return AuthCoordinator(model: person) //TODO: MainCoordinator()
}
}()
root?.setRoot(for: window)
}
}
class AuthCoordinator: NavigationCoordinator {
private let disposeBag = DisposeBag()
private var person: Person
Hi all,
Thanks for the MVC example and the sliders.
I want to create model at first in AppCoordinator and don't want to get instance whole project. I don't know if this is the best way but I need my updated model in all the view controllers. This can any data by the way, I want to pass data using XCoordinator.
My code is like below, router is assigning, but model is still nil in VC? Why?
`class AppCoordinator { var root: Presentable? private var person: Person
}
class AuthCoordinator: NavigationCoordinator { private let disposeBag = DisposeBag() private var person: Person
}`
Thanks!