requestUserInfo(userID) { user, error in if let user = user { downloadImage(user.avatarURL) { avatar, error in if let avatar = avatar { completion(avatar, nil) } else { completion(nil, error) } } } else { completion(nil, error) } } } 4 — "Asynchronous Code with ReactiveCocoa" - Javier Soto. March 2015
"three"] // Imperative var newArray: [String] = [] for string in array { newArray.append(string.uppercaseString) } // Declarative let newArray = array.map { string in return string.uppercaseString } 24 — "Asynchronous Code with ReactiveCocoa" - Javier Soto. March 2015
Crash if observe wrong keypath (stringly-typed API) > Possible crash when de-registering > Easy to break parent class (context often misused) > All observations come through one method > Lose contract: "is this KVO-compliant?" 28 — "Asynchronous Code with ReactiveCocoa" - Javier Soto. March 2015
seek better alternatives. > There's value in these abstractions. > ReactiveCocoa can be adopted slowly. 32 — "Asynchronous Code with ReactiveCocoa" - Javier Soto. March 2015