Posted at

for...in と if を設置した構文を略す

var allMusic = [Music]

for musicItem in musics {
if !AudioDownloadService.shared.isDownloaded(title: musicItem.title){
allMusics.append(musicItem)
}
}

これをもっとシンプルに書く

let allMusics = musics.filter { !AudioDownloadService.shared.isDownloaded(title: $0.title)}