     
     The RF2616 standard is completely covered (http://www.ietf.org/rfc/rfc2616.txt)
  */
-public enum HTTPStatusCode : Int {
+public enum HTTPStatusCode: Int {
     // Informational
     case Continue = 100
     case SwitchingProtocols = 101

}

public extension NSHTTPURLResponse {
    public var statusCodeValue: HTTPStatusCode? {
        return HTTPStatusCode(HTTPResponse: self)
    }
    
    @available(iOS, introduced=7.0)
    public convenience init?(URL url: NSURL, statusCode: HTTPStatusCode, HTTPVersion: String?, headerFields: [String : String]?) {
        self.init(URL: url, statusCode: statusCode.rawValue, HTTPVersion: HTTPVersion, headerFields: headerFields)

        return inRange(500...599)
    }
    
    /// - returns: `true` if the status code is in the provided range, false otherwise.
    private func inRange(range: Range<Int>) -> Bool {
        return range.contains(rawValue)
    }
}

public extension HTTPStatusCode {
    /// - returns: a localized string suitable for displaying to users that describes the specified status code.
    public var localizedReasonPhrase: String {
        return NSHTTPURLResponse.localizedStringForStatusCode(rawValue)
    }
