This Package borns as a way to create a SPM over an API and the lucky one is Unsplash π·
- iOS 12+
- XCode 11+
Get Random Photo
.package(url: "https://github.com/jlainog/unsplash-swift", from: "0.0.1")
To access the Unsplash API you need to register and create an Application here Once you have an accessKey and secretKey configure the api using the line below.
Unsplash.configure(accessKey: String, secret: String)
Each Method returns an URLSessionDataTask
DataTaskFactory.randomPhoto { (result) in
switch result {
case .success(let photo):
dump(photo)
default: break
}
}.resume()
Currently the factory supports:
- randomPhoto
- searchPhotos
- collection
unsplash-swift is under MIT license.