         
         // better photo fetch options
         let options: PHImageRequestOptions = PHImageRequestOptions()
+        
+        // important for loading network resources and progressive handling with callback handler
         options.isNetworkAccessAllowed = true
         
         /*

    // Asset to be displayed - can be NIL when called
    var asset: PHAsset?
    
    let zoomFactor = 2.5
    let screenWidth = 1920
    let screenHeight = 1080
    

        case fastFormat
       */
        
        //
        //options.deliveryMode = .opportunistic
        options.deliveryMode = .highQualityFormat
       
        options.version = .current
        
        // only on async the handler is being requested
        options.isSynchronous = true
        
        let handler : PHAssetImageProgressHandler = { (progress, error, stop, info) in
            // your code
            print("---------------------------------------------==============")
            print("progress \(progress)")
            print("error \(error)")
            print("stop \(stop)")
            print("info \(info)")
            
        }
        
        options.progressHandler = handler
        
        
        
        if let myAsset = asset{
            // Request an image for the asset from the PHCachingImageManager.
            //  cell.representedAssetIdentifier = asset.localIdentifier
            imageManager.requestImage(for: myAsset, targetSize: imageSize, contentMode: .aspectFit, options: options, resultHandler: { imageResult, infoArray in
                // The cell may have been recycled by the time this handler gets called;
                // set the cell's thumbnail image only if it's still showing the same asset.
                
                
                print("Load information \(infoArray)")
                // HERE WE GET THE IMAGE
                if(imageResult == nil){
                    print("============= error loading image =========================")
                    return
                }
         
                self.imageView.image = imageResult
                
                //self.imageView.image = image! as UIImage
                print("detail image was loaded")
