artistName
TypeScriptget artistName(): stringSwift declarationlet artistName: StringThe name of the artist or performer.
struct · iOS 27.0+ · SDK 27.1
struct MusicContentContent representing a music track or song. Use this type for music playback, including songs, albums, and playlists. The following example shows how to create music content with additional metadata: ```swift var content: some MediaContentRepresentable { var content = MusicContent( id: track.id, songTitle: track.title, artistName: track.artist, albumName: track.album, type: .audio, duration: .finite(track.duration), artwork: Artwork(id: track.artworkID) { size in let data = await loadArtworkData(size: size) return try ArtworkRepresentation(data: data) } ) content.composer = track.composer content.genre = track.genre content.isExplicit = track.isExplicit return content } ```
get artistName(): stringSwift declarationlet artistName: StringThe name of the artist or performer.
get isExplicit(): (boolean) | nullSwift declarationvar isExplicit: Bool?A Boolean value that indicates whether this content is explicit.
set isExplicit(value: (boolean) | null)Swift declarationvar isExplicit: Bool?A Boolean value that indicates whether this content is explicit.
get animatedArtwork(): (AnimatedArtwork) | nullSwift declarationlet animatedArtwork: AnimatedArtwork?Animated artwork for this content.
get isExcludedFromSuggestions(): (boolean) | nullSwift declarationvar isExcludedFromSuggestions: Bool?A Boolean value that indicates whether to exclude this content from media suggestions. Defaults to `false`.
set isExcludedFromSuggestions(value: (boolean) | null)Swift declarationvar isExcludedFromSuggestions: Bool?A Boolean value that indicates whether to exclude this content from media suggestions. Defaults to `false`.
static initIdSongTitleArtistNameAlbumNameTypeDurationArtworkAnimatedArtwork(id: string, songTitle: string, artistName: string, albumName: string, type: MediaType, duration: (MediaDuration) | null, artwork: Artwork, animatedArtwork?: (AnimatedArtwork) | null): MusicContentSwift declarationinit(id: String, songTitle: String, artistName: String, albumName: String, type: MediaType, duration: MediaDuration?, artwork: Artwork, animatedArtwork: AnimatedArtwork?)Creates music content with static and animated artwork. Use this initializer when your track has a matching animated asset, for example motion album art. - Parameters: - id: A unique identifier for this track. - songTitle: The song's display title. - artistName: The name of the artist or performer. - albumName: The album this track belongs to. - type: The media type. - duration: The total duration of the track, or `nil` when unknown. - artwork: Static artwork for the track. - animatedArtwork: Animated artwork for the track, or `nil` when unavailable.
static initIdSongTitleArtistNameAlbumNameTypeDurationArtwork(id: string, songTitle: string, artistName: string, albumName: string, type: MediaType, duration?: (MediaDuration) | null, artwork?: (Artwork) | null): MusicContentSwift declarationinit(id: String, songTitle: String, artistName: String, albumName: String, type: MediaType, duration: MediaDuration?, artwork: Artwork?)Creates music content with the specified metadata. - Parameters: - id: A unique identifier for this track. - songTitle: The song's display title. - artistName: The name of the artist or performer. - albumName: The album this track belongs to. - type: The media type. - duration: The total duration of the track, or `nil` when unknown. - artwork: Album artwork for the track, or `nil` when unavailable.
get id(): stringSwift declarationlet id: StringThe unique identifier for this content.
get isrc(): (string) | nullSwift declarationvar isrc: String?The International Standard Recording Code (ISRC) for this content. ISRC is an industry-standard identifier for sound recordings. The system uses this value to integrate with the Music Haptics accessibility feature.
set isrc(value: (string) | null)Swift declarationvar isrc: String?The International Standard Recording Code (ISRC) for this content. ISRC is an industry-standard identifier for sound recordings. The system uses this value to integrate with the Music Haptics accessibility feature.
get type(): MediaTypeSwift declarationlet type: MediaTypeThe media type (audio or video).
get genre(): (string) | nullSwift declarationvar genre: String?The genre of this content.
set genre(value: (string) | null)Swift declarationvar genre: String?The genre of this content.
get artwork(): (Artwork) | nullSwift declarationlet artwork: Artwork?Artwork for this content.
get composer(): (string) | nullSwift declarationvar composer: String?The name of the composer, if applicable.
set composer(value: (string) | null)Swift declarationvar composer: String?The name of the composer, if applicable.
get duration(): (MediaDuration) | nullSwift declarationlet duration: MediaDuration?The duration of this content.
get albumName(): stringSwift declarationlet albumName: StringThe name of the album.
get songTitle(): stringSwift declarationlet songTitle: StringThe title of the song.
No declarations were skipped in this snapshot.