This Package borns as a way to create a SPM over an API and the lucky one is Unsplash 📷
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:
unsplash-swift is under MIT license.
link |
Stars: 0 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics