I changed the type of my controller from a collection view controller to a view controller and now the collection view datasource methods aren't recognised.
I replaced the collection view controller in my storyboard with the new view controller. I then added a collection view to the view controller. I controller dragged the collection view to set it as an outlet. I set the delegate and datasources.
I added the protocols with the class definition:
class MessagesViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate
I get the error "Method does not override any method from its superclass." on the line:
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell