Last active
November 26, 2019 17:53
-
-
Save robertmryan/4e4f52dcb4222db4b5ec777d824db549 to your computer and use it in GitHub Desktop.
This file contains 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
let group = DispatchGroup() | |
for album in albums { | |
let formattedAlbum = AlbumFormatted(context: self.persistenceManager.context) | |
formattedAlbum.albumName = album.name | |
group.enter() | |
self.getTracklist(album: album.id!) { data in | |
// do whatever you need to add this `data` to your temporary result set | |
group.leave() | |
} | |
} | |
group.notify(queue: .main) { | |
// now everything should be there | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment