Michael Long
6 days ago

--

btw, the following block doesn't work

guard let httpResponse = response as? HTTPURLResponse,

httpResponse.statusCode == 200 else {

throw NetworkError.badStatus(httpResponse.statusCode)

}

If the first guard condition fails there's no httpResponse to extract a status code from/

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

No responses yet