Introduction of Optional, Result and Deferred types in order to write better apps faster using Swift. This was the result of our learning process of bringing Swift to the Wallapop codebase.
with objects and APIs you did not write - No more maintenance code like Assertions when an API is called incorrectly or an object is initialised incorrectly
let result = divide(dividend :2.5, divisor:3) switch result { case .Success(let quotient): doSomethingWithResult(quotient) case .Failure(let error): print(error) }
being used. ✓ When calling upon, you can schedule a closure on any GCD queue, and, unlike completionBlocks in ObjC, multiple closures can be scheduled to be executed.