I am following this (http://www.raywenderlich.com/78550/beginning-ios-collection-views-swift-part-1) tutorial, and now i am
getting this error :
Redundant conformance of 'FlickrPhotosViewController' to protocol 'UICollectionViewDataSource'
So i have this code over here :
extension FlickrPhotosViewController : UICollectionViewDataSource {
//1
override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
return searches.count
}
//2
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return searches[section].searchResults.count
}
//3
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath)
cell.backgroundColor = UIColor.blackColor()
// Configure the cell
return cell
So what does this error mean?
any help would be appreciated.
"Redundant conformance" means that you are specifying extension FlickrPhotosViewController : UICollectionViewDataSource
, but this isn't necessary because FlickrPhotosViewController
's superclass already provides a UICollectionViewDataSource
conformance.
You can just use extension FlickrPhotosViewController
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With