ScrobbleKit

1.0.3

A Swift library for interacting with the Last.fm API on Apple platforms
tfmart/ScrobbleKit

What's New

ScrobbleKit 1.0.3

2024-03-25T16:33:17Z

Hey there! This patch includes the following changes:

  • Updated the url property type from both SBKAlbum and SBKTag models from an optional String to an optional URL (#7)

Thanks for trying out ScrobbleKit, if you need any assistance or have any feedback, feel free to open a new issue or to contribute with a pull request!

ScrobbleKit

ScrobbleKit is a Swift library designed to simplify interactions with the Last.fm API on Apple platforms

Getting Started

To begin using ScrobbleKit, create an instance of SBKManager by providing your API and Secret key from Last.fm

import ScrobbleKit

let manager = SBKManager(apiKey: API_KEY,
                         secret: SECRET_KEY)

You can utilize the available API methods through the manager, which supports both async/await and completion handler-based approaches.

Async/Await

do {
    let album = try await manager.getInfo(forAlbum: .albumArtist(album: "Random Access Memories",
                                                                 artist: "Daft Punk"))
    // Use 'album' here
} catch {
    // Handle error
}

Completion Handler

manager.getInfo(forAlbum: .albumArtist(album: "Random Access Memories",
                                       artist: "Daft Punk"))
{ album, error in
    if let album = album {
        // Use 'album' here
    } else if let error = error {
        // Handle error
    }
}

For more detailed information on API methods available through ScrobbleKit, check out the full documentation

Requirements

  • iOS 13.0 or later
  • macOS Catalina or later
  • watchOS 6.0 or later
  • tvOS 13.0 or later

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

Last updated: Fri Oct 18 2024 21:45:05 GMT-0900 (Hawaii-Aleutian Daylight Time)