Last active
July 16, 2018 17:26
-
-
Save jayrhynas/968458323978265f5764ae64670aee7d 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 TrackProvider { | |
var track: Track? { get } | |
func observeTrack(_ block: (TrackProvider, NSKeyValueObservedChange<Track>)) -> NSKeyValueObservation | |
} | |
extension TrackProvider where Self: NSObject { | |
func observeTrack(_ block: (TrackProvider, NSKeyValueObservedChange<Track?>)) -> NSKeyValueObservation { | |
return self.observe(\TrackProvider.track) { obj, change in | |
} | |
} | |
} |
Author
jayrhynas
commented
Jul 16, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment