diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..5186d07 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +4.0 diff --git a/Example/Utils/UIViewControllerExtension.swift b/Example/Utils/UIViewControllerExtension.swift index 0c8de71..fae6eb4 100644 --- a/Example/Utils/UIViewControllerExtension.swift +++ b/Example/Utils/UIViewControllerExtension.swift @@ -65,7 +65,7 @@ extension UIViewController { basicAnimation?.duration = 1.0 basicAnimation?.isRemovedOnCompletion = false basicAnimation?.fromValue = gradientLayer?.colors - basicAnimation?.toValue = toColors.flatMap({ $0.cgColor }) + basicAnimation?.toValue = toColors.compactMap({ $0.cgColor }) guard let gradient = gradientLayer, let animation = basicAnimation else { return diff --git a/Unsplasher/Info.plist b/Unsplasher/Info.plist index 1007fd9..e234e4b 100644 --- a/Unsplasher/Info.plist +++ b/Unsplasher/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0 + 1.0.3 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Unsplasher/Unsplash/Requests/CollectionRequests.swift b/Unsplasher/Unsplash/Requests/CollectionRequests.swift index 81b318b..ea816dc 100644 --- a/Unsplasher/Unsplash/Requests/CollectionRequests.swift +++ b/Unsplasher/Unsplash/Requests/CollectionRequests.swift @@ -68,7 +68,7 @@ final public class CollectionRequests: Paginable { parameters["per_page"] = perPage } let url = Unsplash.collectionsURLString + (curated ? "/curated/\(collectionId)" : "/\(collectionId)") + "/photos" - self.manager.request(url: url, expectedType: [Photo].self, completion: completion) + self.manager.request(url: url, parameters: parameters, expectedType: [Photo].self, completion: completion) } /// Get a list of collections related with a given one diff --git a/Unsplasher/Unsplash/Requests/PhotoRequests.swift b/Unsplasher/Unsplash/Requests/PhotoRequests.swift index e93a4e0..50d0116 100644 --- a/Unsplasher/Unsplash/Requests/PhotoRequests.swift +++ b/Unsplasher/Unsplash/Requests/PhotoRequests.swift @@ -59,7 +59,7 @@ final public class PhotoRequests: Paginable { parameters["h"] = height } if let rect = rect { - let dimensions = rect.split(separator: ",").flatMap({ UInt32($0) }) + let dimensions = rect.split(separator: ",").compactMap({ UInt32($0) }) if dimensions.count == 4 { parameters["rect"] = rect } diff --git a/Unsplasher/Utils/StringExtension.swift b/Unsplasher/Utils/StringExtension.swift index a04c68c..52b1773 100644 --- a/Unsplasher/Utils/StringExtension.swift +++ b/Unsplasher/Utils/StringExtension.swift @@ -14,7 +14,7 @@ extension String { do { let regex = try NSRegularExpression(pattern: self) let results = regex.matches(in: text, range: NSRange(text.startIndex..., in: text)) - return results.flatMap { + return results.compactMap { String(text[Range($0.range, in: text)!]) } } catch let error { diff --git a/UnsplasherSDK.podspec b/UnsplasherSDK.podspec index 7d395d6..6b18fb8 100644 --- a/UnsplasherSDK.podspec +++ b/UnsplasherSDK.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "UnsplasherSDK" - s.version = "1.0.2" + s.version = "1.0.3" s.summary = "Unsplash API client written in Swift." # This description is used to generate tags and improve search results.