Khanh Pham
Mar 21 ยท 1 min read

Thank you for your great post. I tried to set up an example project to reproduce this but it still can deinit, can you help to take a look. Below is the code:

class ViewController: UIViewController {@IBOutlet weak var cardImageView: UIImageView!let disposeBag = DisposeBag()let divider = 100deinit {print("deinit vc")}override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view, typically from a nib.ExampleRepository.shared.getSomething().flatMapLatest({ (value) -> Observable<Int> inreturn .just(value % self.divider)}).map { (value) -> Int inreturn value % self.divider}.subscribe(onNext: { value inprint(value)}).disposed(by: disposeBag)}}class ExampleRepository {static let shared = ExampleRepository()func getSomething() -> Observable<Int> {return .just(Int(Date().timeIntervalSince1970))}}
    Khanh Pham

    Written by

    iOS Developer