I started dabbling with the iTunes library for Swift and came across the example below on line for reading data from the library on MacOS. However, I keep getting hit with a "Type of expression is ambiguous without more context" error on line 6. I can't think of what is causing the error, any ideas ?
Code Block func ListTunes(){ if let library = try? ITLibrary(apiVersion: "1") { print(library.applicationVersion) for artist in library.allMediaItems .filter({ $0.mediaKind == ITLibMediaItemMediaKind.kindSong }) .group(by: { $0.artist?.title }){ print(artist.key) for album in artist.value.group(by: { $0.album.title }) { print(" \(album.key) (\(album.value.first!.year))") } } } }