Swiftpack.co - FreeApp2014/SwiftyCM as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by FreeApp2014.
FreeApp2014/SwiftyCM list
A swift library for accessing SCM Archive API
⭐️ 4
🕓 2 years ago
.package(url: "https://github.com/FreeApp2014/SwiftyCM.git", from: "list")

SwiftyCM

A Swift library for interacting with Smash Custom Music Archive API. Compatible with Linux and macOS.

Usage

This library can be imported into your project using SPM:

    .package(url:"https://github.com/FreeApp2014/SwiftyCM")

to your package.dependencies and dependencies: ["SwiftyCM"] in your main target.

Example usage

The following code prints all songs from a game that match the criteria

import Foundation
import SwiftyCM
do {
    let game = try Game("4771");
    var neededSongs: [Song] = [];
    for song in game.songs {
        if(song.secLength < 40 && song.secLength > 10){
            neededSongs.append(try song.resolveSong());
        }
    }
    for song in neededSongs {
        print(song.id, song.title);
    }

} catch {
    fatalError("API error");
}

Documentation

The documentation for this project can be built using jazzy. The pre-built documentation can be found in docs/ or on the Github Pages

GitHub

link
Stars: 4
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

2.0.0
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics