Skip to content

Instantly share code, notes, and snippets.

@greenchiu
Last active October 15, 2017 16:00
Show Gist options
  • Save greenchiu/38ae39a8ff5923f480f64d1215c884c5 to your computer and use it in GitHub Desktop.
Save greenchiu/38ae39a8ff5923f480f64d1215c884c5 to your computer and use it in GitHub Desktop.
Original code.
- (viod)loadSongInfo:(LocalSongInfo *)inSongInfo
{
// load image
if (inSongInfo.source == ... ) {
self.coverImage.image = [[MediaItem itemWithSongID:...].artwork imageWith...];
}
else if (inSongInfo.source == ... ) {
SongMetadata *metadata = ...
[metadata getImagWithCallback:...]
}
else if (inSongInfo.source == ... ) {
...
}
else {
...
}
// update UI
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment