Skip to content

FreeApp2014/SwiftyCM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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