                 Static.defaultImageCache!.removeAllObjects()
             }
         })
-        return objc_getAssociatedObject(self, &AssociatedKeys.SharedImageCache) as? AFImageCache ?? Static.defaultImageCache!
+        return objc_getAssociatedObject(self, &AssociatedKeys.SharedImageCache) as? AFImageCacheProtocol ?? Static.defaultImageCache!
     }
     
-    class func af_sharedImageRequestOperationQueue() -> NSOperationQueue {
+    private class func af_sharedImageRequestOperationQueue() -> NSOperationQueue {
         struct Static {
             static var token:dispatch_once_t = 0
             static var queue:NSOperationQueue?


import UIKit

protocol AFImageCacheProtocol:class{
    func cachedImageForRequest(request:NSURLRequest) -> UIImage?
    func cacheImage(image:UIImage, forRequest request:NSURLRequest);
}

        }
    }
    
    public func setImageWithUrl(url:NSURL, placeHolderImage:UIImage? = nil) {
        let request:NSMutableURLRequest = NSMutableURLRequest(URL: url)
        request.addValue("image/*", forHTTPHeaderField: "Accept")
        self.setImageWithUrlRequest(request, placeHolderImage: placeHolderImage, success: nil, failure: nil)
    }
    
    public func setImageWithUrlRequest(request:NSURLRequest, placeHolderImage:UIImage? = nil,
        success:((request:NSURLRequest?, response:NSURLResponse?, image:UIImage) -> Void)?,
        failure:((request:NSURLRequest?, response:NSURLResponse?, error:NSError) -> Void)?)
    {
