This package makes data from the last.fm api available via observables in Swift.
let lastfm = LastFMApi(apiKey: apiKey)
lastfm.info(artist: "Tame Impala")
.subscribe(onNext: { (info) in
print("Artist info: \(info)")
})
.disposed(by: bag)
- Xcode 11 or Swift Package Manager
- Swift 5.0
lastfm-api-swift depends on RxSwift. To use the library, you will need a last.fm api key.
Unit tests are included. To run those, you have to set an environment variable for the last.fm api key. To run the tests from the command line, use the following command: LASTFM_API_KEY=YOURKEY swift test
Currently only build and usage via swift package manager is supported. The easiest way to add the library is directly from within XCode (11). Alternatively you can create a Package.swift
file.
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "MyProject",
dependencies: [
.package(url: "https://github.com/katoemba/lastfm-api-swift.git", from: "0.0.1")
],
targets: [
.target(name: "MyProject", dependencies: ["LastFMApi"])
]
)