     
     
 }
+
+public enum HKAlamofireImageType{
+    
+    case rounded
+    case normal
+}

    
    private var recipt:RequestReceipt?
    static var downloader = ImageDownloader(
                configuration: ImageDownloader.defaultURLSessionConfiguration(),
                downloadPrioritization: .lifo,
                maximumActiveDownloads: 4,
                imageCache: AutoPurgingImageCache()
            )
    
    public func cancelRequest(){
        guard let request = recipt else {

        
    }
    
    public func downloadImage(url:URL?,placeHolder:UIImage,imageType:HKAlamofireImageType = .normal) {
        self.image = placeHolder
        guard let url = url else {
            return
        }
        
        self.recipt = HKAlamofireImageView.downloader.download(URLRequest(url:url), completion: { (response) in
            
            
            if let image = response.result.value {
                
                if imageType == .rounded {
                    self.image = image.af_imageRoundedIntoCircle()
                }else{
                    self.image = image.af_imageAspectScaled(toFit: self.frame.size)
                }
                
                
            }
            
            
        })
