0
votes

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()

enter image description here

Thanks in advance!

1
What is the modalView ??dahiya_boy
make sure collectionView IBOutlet connected to interface builderGanesh Manickam
How do you "dismiss modalView3 to rootVC"? Show your codeRajeshKumar R
Can u update your question with your code.KAVIYA VENKAT
"modalView1": You mean modalViewController1? Also, where is collectionView exactly? on rootVC?Larme

1 Answers

0
votes

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.