Reputation: 21
override func layoutAttributesForElements(in rect: CGRect) -> [AnyObject]? {
var layoutAttributes = [UICollectionViewLayoutAttributes]()
// Loop through the cache and look for items in the rect
for attributes in cache {
if attributes.frame.intersects(rect ) {
layoutAttributes.append(attributes)
}
}
return layoutAttributes }
Here I'm getting the error.
Method does not override any method from it's superclass.
How can I resolve the issue.
Any one can you please help me.
Thanks in Advance.
Upvotes: 0
Views: 1661
Reputation: 1348
If you are really trying to override that method in its right place, Try removing the method name and type override func layoutAttributes
and select the correct override from auto complete. These kind of problems sometimes occur because of Swift's syntax changes in different versions of swift
Upvotes: 1