lundi 25 juillet 2016

Error: Multiple inheritance from classes 'UICollectionViewController' and 'UICollectionViewLayout'

In Xcode 8 I'm trying to make a subclass of UICollectionViewController and UICollectionViewLayout but I get the error:

Multiple inheritance from classes 'UICollectionViewController' and 'UICollectionViewLayout'

but they have different parents classes. I'm trying to follow http://nshint.io/blog/2015/07/16/uicollectionviews-now-have-easy-reordering/ tutorial for reorder custom size cells

class WordCollectionViewController: UICollectionViewController, UICollectionViewLayout {
    // ...
    override func invalidationContext(forInteractivelyMovingItems targetIndexPaths: [IndexPath], withTargetPosition targetPosition: CGPoint, previousIndexPaths: [IndexPath], previousPosition: CGPoint) -> UICollectionViewLayoutInvalidationContext {
            var context = super.invalidationContext(forInteractivelyMovingItems: targetIndexPaths, withTargetPosition: targetPosition, previousIndexPaths: previousIndexPaths, previousPosition: previousPosition)

        return context
    }
}

Aucun commentaire:

Enregistrer un commentaire