i have two errors "Unbalanced calls to begin/end appearance transitions for DonesViewController"(its my last viewcontroller) and the same error fot BottomSheetViewController, when i try to dismiss all views and go to main view. I have a navigation controller in the main viewcontroller, and then i used modal presented.
This is my code:
viewModel.result
.observe(on: MainScheduler.instance)
.withUnretained(self)
.subscribe(onNext: { owner, result in
let vm = ResultViewModel(state: result)
let vc = ResultViewController(with: vm)
vc.modalPresentationStyle = .fullScreen
owner.present(vc, animated: true)
let rootViewController = owner.view.window?.rootViewController as? UINavigationController
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
rootViewController?.setViewControllers([rootViewController!.viewControllers.first!],
animated: false)
rootViewController?.dismiss(animated: false, completion: nil)
}
}).disposed(by: disposeBag)