我有集合视图,如果选择了单元格,则下载pdf文件。下载完成并再次选择单元格后,它将推送到另一个视图控制器。但它没有推动,有人可以解释为什么吗?
这是我的代码
if self.percentProgressFinal == 1.0 { //download complete
print("SUCCESS")
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("NEXT")
self.navigationController?.pushViewController(vc, animated: true)
} else {
print("still downloading")
}
成功打印“SUCCESS”但代码不会执行。我也尝试使用礼物和本
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let nextViewController: redirectMagazineViewController = storyBoard.instantiateViewControllerWithIdentifier("NEXT") as! redirectMagazineViewController // my second view controller name
self.navigationController?.pushViewController(nextViewController, animated: true)
仍然无法正常工作。我确定我的故事板ID是“NEXT”。