Lory Huz Lory Huz - 4 months ago 40
iOS Question

XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass

I encounter some issues on collectionView & collectionViewLayout on Xcode 8 + Swift 3 project.

It's seems some methods totally disappeared.

For example, when I subclass UICollectionViewFlowLayout:

override func layoutAttributesClass() -> AnyClass

This trigger xcode error:

Method does not override Any Method from his superclass

Documentation of this method:

Not sure it's Xcode 8 related because I already have strange issues with collectionView on Xcode 7 and swift 2.3, for example, itemSizeAtIndexPath method is not detected on xcode but if I put the method in a collectionViewController it's called even without the keyword override.


In Swift 3, it is a (class) property instead of a method:

override class var layoutAttributesClass: AnyClass {
    // ...