Skip to content
No description, website, or topics provided.
Swift
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swiftpm/xcode/package.xcworkspace
Sources/LastfmApi
Tests
.gitignore
Package.resolved
Package.swift
README.md

README.md

bitrise CI platforms Swift Package Manager compatible

lastfm-api-swift

This package makes data from the last.fm api available via observables in Swift.

Usage

  let lastfm = LastFMApi(apiKey: apiKey)
  lastfm.info(artist: "Tame Impala")
      .subscribe(onNext: { (info) in
          print("Artist info: \(info)")
      })
      .disposed(by: bag)

Requirements

  • Xcode 11 or Swift Package Manager
  • Swift 5.0

Dependencies

lastfm-api-swift depends on RxSwift, Alamofire and RxAlamofire. To use the library, you will need a last.fm api key.

Testing

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

Installation

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"])
  ]
)
You can’t perform that action at this time.