in tutorials/tutorial4/TicTacToe/Root/RootViewController.swift [47:66]
func replaceModal(viewController: ViewControllable?) {
targetViewController = viewController
guard !animationInProgress else {
return
}
if presentedViewController != nil {
animationInProgress = true
dismiss(animated: true) { [weak self] in
if self?.targetViewController != nil {
self?.presentTargetViewController()
} else {
self?.animationInProgress = false
}
}
} else {
presentTargetViewController()
}
}