All posts tagged “swift”

retain cycles in Swift

turns out they are still a problem, but instead of the good old weakify-strongify dance we have to use [weak self], like so:

model.errors.subscribeNext {
[weak self] (next: AnyObject!) -> () in
if let error = next as? NSError {
self!.services.showError(error)
}
return
}