Nandu Psycho
Nandu Psycho

Reputation: 21

Method does not override any method from it's superclass in Swift3?

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

Answers (2)

MohyG
MohyG

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

user5900355
user5900355

Reputation:

Try removing the override should work.

Upvotes: 0

Related Questions