【发布时间】:2018-09-08 23:10:13
【问题描述】:
我有一个具有UICollectionView 的应用程序。当用户点击单元格(不是单元格本身)上的按钮时,自定义弹出窗口UIViewController 会出现UITableView 中显示的选项列表。当用户点击其中一个选项(行)时,当前自定义弹出窗口UIViewController 将被关闭,并显示一个新的UIViewController。我使用委托/协议来做到这一点。
我的问题如下。当我点击我的一个选项时,在它被关闭之前有一个很长的延迟 1-4 秒,另一个 UIViewController 出现了。在其他时候,它是即时的,没有延迟。当出现延迟时,我在控制台中发现了以下错误消息。任何人都可以建议吗?我目前遇到 indexPath[0,2] 行的这个问题 - 请参见下文。
错误信息:
myApplicationName[7141:3954956] [BoringSSL] 函数boringssl_session_errorlog:第 2881 行 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6):操作失败,因为连接已通过 close_notify 警报彻底关闭
我的UITableView 代码用于点击一行:
class MoreOptionsOnPDFViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
....
var moveDocDelegate: MoveFolder!
// TAP ON ROW
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath == [0,0]{ // EDIT FILE NAME
print("EDIT FILENAME")
} else if indexPath == [0,1]{ // EDIT TAGS
print("EDIT DOCUMENT")
}else if indexPath == [0,2]{ // MOVE FOLDER
guard let scanID = self.scanID else{return}
if let scanID = self.scanID{
// SHOW MOVE DOCUMENT UIVIEWCONTROLLER
dismiss(animated: true) {
self.moveDocDelegate.moveDocument(scanId: scanID)
}
}
} else if indexPath == [0,3]{ // SHARE DOCUMENT
print("SHARE DOCUMENT")
if let pdfURL = self.pdfURL{
self.sharePDF(pdfURL: pdfURL)
}
} else if indexPath == [0,4]{ // BIN
}
}
}
其他类:
class CollectionViewFolder: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate ,UICollectionViewDelegateFlowLayout, MoreInfoDocument, MoveFolder{
// SHOW MOVE FOLDER OPTIONS
func moveDocument(scanId: String) {
let moveFolderVC = storyboard?.instantiateViewController(withIdentifier: "movefolder") as! MoveFolderViewController
moveFolderVC.scanId = scanId
present(moveFolderVC, animated: true, completion: nil)
}
}
【问题讨论】: