Last active
March 14, 2017 14:35
-
-
Save dalu93/77f02a7258b2abbcde73b89ed39d2f09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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