TL;DR; Solution can be also found here. Supposing we’re writing a client-server communication layer, and we want to add support for retrying failed calls for a number of times before giving up and reporting error. A classical example would be updating a user’s profile when pressing a Save button from the UI. A typical function might look like […]
Month: January 2016
if-let statement in Objective-C
I just found an equivalent to Swift’s if-let construct, and thought to share it 🙂 Swift: [swift gutter=”false”] if let result = computeResult() { // do something with result } [/swift] Objective-C: [objc gutter=”false”] for(SomeClass *result = [self computeResult]; result != nil; result = nil) { // do something with result } [/objc] You no […]
Recent Comments