Reputation: 791
i have collection view and if cell selected, it downloading a pdf file. After download completed and select the cell again, it push to another view controller. But it doesnt push, can someone explain why?
here's my code
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")
}
It successful printing "SUCCESS" but the code wont execute. I Also try use present and this
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)
and still doesnt work. I'm sure my storyboard id is "NEXT".
Upvotes: 1
Views: 1001
Reputation: 41
Did you check the button " use storyboard id" on your Identity Inspector view controller?
Upvotes: 0