I'm constructing a tabView with a collectionView as one of the tabs. In the tabView, I have a button that takes a Photo and adds it to the collection view. The problem I'm facing is reloading the collection view from the TabView, because I'm getting the following error: "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'UICollectionView must be initialized with a non-nil layout parameter'"
In the TabView I'm calling this function: PhotoListController().reloadData()
And in the PhotoListController, that function is:
func reloadData() {
getData() //function that goes through an array with the data of the images
self.collectionView!.reloadData()
}
When I had everything in the same class, it worked pretty well, but now I can't fix the problem :(
If anybody can give me a hand it would be very much appreciated.