hogumachu / AWord

영어 단어장 애플리케이션
2 stars 0 forks source link

AlertView (Instance) + RxSwift #4

Open hogumachu opened 2 years ago

hogumachu commented 2 years ago

AlertView 가 deinit 되고 난 후 TestViewModel 에 있는 next method 가 호출 될 수 있도록 하기

TestViewModel 에 있는 testResultAlert method 에서 next method 를 호출하면 Reentrancy anomaly was detected 라고 나옴 (RxSwift 에러 같음)

hogumachu commented 2 years ago
 func testResultAlert(testReuslt: TestResult) {
    switch testReuslt {
    case .normal:
        return
    case .right:
        AlertView.showCheckMark("정답입니다")
    case .wrong:
        AlertView.showXMark("오답입니다")
    }

// 아마 testResultAlert 가 끝나고 next가 호출되야 되는데 AlertView 가 present 된 상태에서 호출되니까 그런거 같음
    next()
}