Chapter 6: func ErrorMessage, page 196

private func errorMessage() {
  alert(title: "No access to Camera Roll", 
    text: "You can grant access to Combinestagram from the Settings app")
    .subscribe(onDisposed: { [weak self] in
      self?.dismiss(animated: true, completion: nil)
      _ = self?.navigationController?.popViewController(animated: true)
    })
    .disposed(by: bag)
}

doesn’t compile because “alert” is a Completable and onDisposed is not a valid parameter. Add “asObservable()” before the subscribe then makes the code work as expected.

will look into this thanks!

There is a mismatch between the pdf and the final code.
You could replace “onDisposed:” with “onCompleted” as in the final code and it will work.

I’ve just noticed that as well. Also the snippet after "“Trying out time based filter operators” is missing .asObservable() since the alert returns an Completable

is

.take(5.0, scheduler: MainScheduler.instance)
[existing code: .subscribe(onDisposed: ...]

should be

. asObservable()
.take(5.0, scheduler: MainScheduler.instance)
[existing code: .subscribe(onDisposed: ...]

This topic was automatically closed after 166 days. New replies are no longer allowed.