Skip to content

Commit f32b00b

Browse files
author
Jacob Rhoda
committed
Fix build by making code suceed linting.
1 parent eb072e3 commit f32b00b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Source/ImageGallery/ImageGalleryLayout.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff 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
}

Source/ImageGallery/ImageGalleryView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import UIKit
22
import Photos
3+
34
private 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:

0 commit comments

Comments
 (0)