File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,12 @@ class ImageGalleryLayout: UICollectionViewFlowLayout {
1818 return super. layoutAttributesForElements ( in: rect)
1919 }
2020
21- var newAttributes = [ UICollectionViewLayoutAttributes] ( )
22- for attribute in attributes {
21+ let newAttributes = attributes. map ( { ( attribute) -> UICollectionViewLayoutAttributes in
2322 // swiftlint:disable force_cast
24- let n = attribute. copy ( ) as! UICollectionViewLayoutAttributes
25- n . transform = configuration. rotationTransform
26- newAttributes . append ( n )
27- }
23+ let newAttribute = attribute. copy ( ) as! UICollectionViewLayoutAttributes
24+ newAttribute . transform = configuration. rotationTransform
25+ return newAttribute
26+ } )
2827
2928 return newAttributes
3029 }
Original file line number Diff line number Diff line change 11import UIKit
22import Photos
3+
34private func < < T: Comparable > ( lhs: T ? , rhs: T ? ) -> Bool {
45 switch ( lhs, rhs) {
5- case let ( l ? , r ? ) :
6- return l < r
6+ case let ( someLhs ? , someRhs ? ) :
7+ return someLhs < someRhs
78 case ( nil , _? ) :
89 return true
910 default :
You can’t perform that action at this time.
0 commit comments