NSHTTPURLResponse+Haneke.swift 379 B

12345678910111213141516171819202122
  1. //
  2. // NSHTTPURLResponse+Haneke.swift
  3. // Haneke
  4. //
  5. // Created by Hermes Pique on 1/2/16.
  6. // Copyright © 2016 Haneke. All rights reserved.
  7. //
  8. import Foundation
  9. extension HTTPURLResponse {
  10. func hnk_isValidStatusCode() -> Bool {
  11. switch self.statusCode {
  12. case 200...201:
  13. return true
  14. default:
  15. return false
  16. }
  17. }
  18. }