Explorar o código

Adding URLRequestConvertible protocol

Mattt Thompson %!s(int64=11) %!d(string=hai) anos
pai
achega
5b94f2a2f1
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      Source/Alamofire.swift

+ 12 - 0
Source/Alamofire.swift

@@ -151,6 +151,18 @@ extension NSURLRequest: URLStringConvertible {
 
 // MARK: -
 
+public protocol URLRequestConvertible {
+    var URLRequest: NSURLRequest { get }
+}
+
+extension NSURLRequest: URLRequestConvertible {
+    public var URLRequest: NSURLRequest {
+        return self
+    }
+}
+
+// MARK: -
+
 public class Manager {
     public class var sharedInstance: Manager {
         struct Singleton {