         let photoName = self.photoList?[(indexPath as NSIndexPath).row] ?? ""
         let photoFilePath = self.photoDirectory()+"/"+photoName
         cell.nameLabel.text = NSString(string: photoName).deletingPathExtension
-        var thumbImage = self.photosCache.object(forKey: photoName as NSString)
+        var thumbImage = self.photosCache[photoName]
         cell.photoView.image = thumbImage
         if thumbImage == nil{
            DispatchQueue.global(qos:.userInitiated).async(execute: { () -> Void in

                }
            }
            DispatchQueue.main.async(execute: { () -> Void in
                self.photosCache.setObject(thumbImage!, forKey: photoName as NSString)
                cell.photoView.image=thumbImage
            })
            

class MKViewController: UICollectionViewController ,UIAdaptivePresentationControllerDelegate{
    var  photoList:[String]?
    fileprivate var  photoOrientation=[PhotoOrientation]()
    fileprivate var  photosCache = [String:UIImage]()
    
    
    func photoDirectory()->String{
