diff --git a/Sources/Mew/Protocols/CellProtocol.swift b/Sources/Mew/Protocols/CellProtocol.swift index 64ed7b8..d8352db 100644 --- a/Sources/Mew/Protocols/CellProtocol.swift +++ b/Sources/Mew/Protocols/CellProtocol.swift @@ -86,10 +86,10 @@ public enum SizeConstraint: Equatable { let direction = (layout as? UICollectionViewFlowLayout)?.scrollDirection let inset = (layout as? UICollectionViewFlowLayout)?.sectionInset ?? UIEdgeInsets.zero var result: Calculated = (nil, nil) - if direction != UICollectionViewScrollDirection.vertical { + if direction != UICollectionView.ScrollDirection.vertical { result.height = frame.height - inset.top - inset.bottom } - if direction != UICollectionViewScrollDirection.horizontal { + if direction != UICollectionView.ScrollDirection.horizontal { result.width = frame.width - inset.left - inset.right } return result diff --git a/Sources/Mew/Utils/BackwardCompatibility.swift b/Sources/Mew/Utils/BackwardCompatibility.swift index 71a824e..5643d80 100644 --- a/Sources/Mew/Utils/BackwardCompatibility.swift +++ b/Sources/Mew/Utils/BackwardCompatibility.swift @@ -37,6 +37,8 @@ extension UICollectionView { static var elementKindSectionFooter: String { return UICollectionElementKindSectionFooter } + + typealias ScrollDirection = UICollectionViewScrollDirection } #endif