Reputation: 134
What I do: rootVC —> modalView1 —> modalView2 —> modalView3 —> dismiss modalView3 to rootVC then reload collectionView
the collectionView is in the rootVC.
This is the code for going back to rootVC: self.view.window!.rootViewController?.dismiss(animated: true, completion: nil)
dismissing to rootVC is working but error occurs during collectionView.reloadData()
Thanks in advance!
Upvotes: 0
Views: 81
Reputation: 1
First, the error message is "found nil", so, in this code, collectionView is nil, you can find the content of collectionView, such as tag, button or label, something in content must do not connect the collectionView.
Upvotes: 0