In my case, the error was "Incorrect name for nib file in:
collectionViewOutlet.register(UINib(nibName: "CollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "Cell")
Recommend making all of them the same, the cell identifier and nibName
as well so make it:
collectionViewOutlet.register(UINib(nibName: "CollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "CollectionViewCell")
If it doesn't work try this:
Target -> Build Phases -> Copy Bundle Resources
You will find your xib/storyborad
with red color.
Just remove it. Also, remove all references of the missing files from the project.
Now drag this storyboard/xib
file again to this Copy Bundle Resources. It will still show you a file with red color but don't worry about it.
Command + Shift + K to clean the project and it will work.