Передайте viewController
объект в UITableViewCell
и замените строку на
self.dic.presentOpenInMenu(from: rect, in: vc.view, animated: true)
В ViewController:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
.....
cell.vc = self
}
В комментариях Клетка:
class CommentsCell: UITableViewCell, UICollectionViewDelegate, UICollectionViewDataSource, UIDocumentInteractionControllerDelegate {
weak var vc: UIViewController!
........
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let fileUrl = imgCollection[indexPath.row].fileUrl?.absoluteString
let url = URL(string: Api.domain + fileUrl!)
let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory)
sharedAFManager.AFManager.download(url!, to: destination)
.downloadProgress(closure: { _ in
SVProgressHUD.show()
}).response(completionHandler: { (downloadResponse) in
SVProgressHUD.dismiss()
self.dic.url = downloadResponse.destinationURL
self.dic.uti = downloadResponse.destinationURL!.uti
let rect = CGRect(x: 0, y: 0, width: 100, height: 100)
self.dic.presentOpenInMenu(from: rect, in: vc.view, animated: true)
})
}
}