在 Xcode 8 中,我尝试创建 UICollectionViewController 和 UICollectionViewLayout 的子类,但出现错误:
从类“UICollectionViewController”和“UICollectionViewLayout”的多重继承
但他们有不同的父母班级。我正在尝试按照http://nshint.io/blog/2015/07/16/uicollectionviews-now-have-easy-reordering/教程重新排序自定义大小的单元格
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
}
}