Spotify 0.2.1

Spotify 0.2.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Miklos Kristyan.



Spotify 0.2.1

  • By
  • Kristyán Miklós

Spotify

A Spotify wrapper class for controlling Spotify on macOS.

This wrapper class was originally created for SpotMenu.

Installation

To integrate Spotify into your Xcode project using CocoaPods, specify it in your Podfile:

platform :osx, '10.10'
use_frameworks!

target '<Your Target Name>' do
    pod 'Spotify', '~> 0.1'
end

Then, run the following command:

$ pod install

Usage example

import Spotify


// Get current artist
if let artist = Spotify.currentTrack.artist {
    print(artist)
}

// Get current track title
if let title = Spotify.currentTrack.title {
    print(title)
}

// Play next song
Spotify.playNext()

For a real-world example checkout SpotMenu