Skip to content

Networking — 3.0.2

Compare
Choose a tag to compare
@3lvis 3lvis released this 06 Feb 12:35
· 131 commits to master since this release
  • Added convenience accessor for the result's error #197

Useful for when you don't care about the result but more if there's an error or not.

Before:

networking.delete("/user/10") { result in
    switch result {
    case .success:
        completion(nil)
    case .failure(let response):
        completion(response.error)
    }
}

Now:

networking.delete("/user/10") { result in
    completion(result.error) // NSError?
}