One Logo Pool Ball
NowPlaying · IOS API REFERENCE

Artwork

struct · iOS 27.0+ · SDK 27.1

struct Artwork

Artwork for a media item that can be requested at a specified size. The following example shows how to attach artwork to a content value: ```swift let 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) } ) ```

Members (2)

init · iOS 27.0+

init

TypeScript
static init(id: string, artworkProvider: ((arg0: { width: number; height: number }) => Promise<ArtworkRepresentation>)): Artwork
Swift declaration
init(id: String, artworkProvider: @escaping @Sendable (CGSize) async throws -> ArtworkRepresentation)

Creates an artwork whose image data loads on demand at the requested size. The provider returns artwork that matches the requested size when possible. One dimension may differ if the artwork's aspect ratio differs from the requested size. If the requested size exceeds the artwork's maximum available size, the provider returns the artwork at its maximum size without enlarging the image. - Parameters: - id: A unique identifier for this artwork. - artworkProvider: A handler the system calls to request an ``ArtworkRepresentation`` for a specified size.

get · iOS 27.0+

id

TypeScript
get id(): string
Swift declaration
let id: String

A unique identifier for this artwork, which the system uses to cache artwork across fetches.

Skipped declarations

No declarations were skipped in this snapshot.

All NowPlaying types →