Open Taehyeon-Kim opened 2 years ago
자자!
// 기존 해결 방법
signUpButton.rx.tap
.subscribe { [weak self] _ in
let alert = UIAlertController(title: "Good", message: nil, preferredStyle: .alert)
let ok = UIAlertAction(title: "Ok", style: .cancel)
alert.addAction(ok)
self?.present(alert, animated: true)
}
.disposed(by: disposeBag)
// RxSwift 6부터의 해결 방법
signUpButton.rx.tap
.withUnretained(self)
.subscribe { vc, _ in
let alert = UIAlertController(title: "Good", message: nil, preferredStyle: .alert)
let ok = UIAlertAction(title: "Ok", style: .cancel)
alert.addAction(ok)
vc.present(alert, animated: true)
}
.disposed(by: disposeBag)
옵저버블, 옵저버의 역할을 모두 하는 녀석
Stream
Sequence, Iterator Protocol
Observable
Observer
Infinite observable sequences
Finite observable sequences