Skip to content

Instantly share code, notes, and snippets.

@dalu93
Last active March 14, 2017 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalu93/77f02a7258b2abbcde73b89ed39d2f09 to your computer and use it in GitHub Desktop.
Save dalu93/77f02a7258b2abbcde73b89ed39d2f09 to your computer and use it in GitHub Desktop.
protocol AudioPlayable {
var audioURL: URL { get }
}
extension SongClip: AudioPlayable {}
struct AudioPlayer {
func play<AudioItem: AudioPlayable>(_ item: AudioItem) {
// play the generic item
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment