是否可以从ViewModel Object推送UIViewController。当我试图推送时,语句正在执行,但UI没有任何变化。这是我的代码,
@objc func attemptQuiz(sender: UIButton){
UserDefaults.standard.setValue(sender.tag, forKey: "Quiz_ID")
let quizListVC = QuizList_ViewController(nibName: "QuizList_ViewController", bundle: nil)
let attemptVC = AttemptQuiz_ViewController(nibName: "AttemptQuiz_ViewController", bundle: nil)
quizListVC.navigationController?.pushViewController(attemptVC, animated: true)
}
这里,func attemptQuiz和它的调用是在ViewModel对象/类中 QuizList_ViewController不在UIViewController类
中