From dd27b41c15156b9ffa1bd29ae3ee842979610849 Mon Sep 17 00:00:00 2001 From: tarunon Date: Sun, 28 Oct 2018 12:56:52 +0900 Subject: [PATCH] backward compatibility --- Sources/Mew/Protocols/CellProtocol.swift | 4 ++-- Sources/Mew/Utils/BackwardCompatibility.swift | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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