Skip to content

Instantly share code, notes, and snippets.

@snowzurfer
Created March 7, 2023 06:08
Show Gist options
  • Select an option

  • Save snowzurfer/f0a5a76ce2d9b595feffb7bb10cc2c86 to your computer and use it in GitHub Desktop.

Select an option

Save snowzurfer/f0a5a76ce2d9b595feffb7bb10cc2c86 to your computer and use it in GitHub Desktop.

Revisions

  1. snowzurfer created this gist Mar 7, 2023.
    7 changes: 7 additions & 0 deletions HTTPURLResponse+Extensions.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    extension HTTPURLResponse {
    /// Returns `true` if `statusCode` is in range 200...299.
    /// Otherwise `false`.
    var is2xx: Bool {
    return 200 ... 299 ~= statusCode
    }
    }