I am creating a social media app and have a collection view to display each image that the user posts. I am having a problem reloading the collection view so that it will display the images immediately after a post. Currently, images will be displayed when the user signs out and then signs back in.
I have been using this code to reload my UICollectionView
:
self.collectionView.reloadData()
However, no matter where I place that line of code in my project I return the error:
"Thread 1: EXC_BAD_INSTRUCTION"
and in some places it also returns:
"fatal error: unexpectedly found nil while unwrapping an optional value"
Does anyone have an idea on why this may be happening? Any help would greatly be appreciated.