A Swift library for interacting with Smash Custom Music Archive API. Compatible with Linux and macOS.
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.
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");
}
The documentation for this project can be built using jazzy.
The pre-built documentation can be found in docs/
or on the Github Pages