<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NowPlaying",
  "identifier" : "/documentation/NowPlaying/Artwork/init(id:artworkProvider:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Now Playing"
    ],
    "preciseIdentifier" : "s:10NowPlaying7ArtworkV2id15artworkProviderACSS_AA0C14RepresentationVSo6CGSizeVYaYbKctcfc"
  },
  "title" : "init(id:artworkProvider:)"
}
-->

# init(id:artworkProvider:)

Creates an artwork whose image data loads on demand at the requested size.

```
init(id: String, artworkProvider: @escaping @Sendable (CGSize) async throws -> ArtworkRepresentation)
```

## Parameters

`id`

A unique identifier for this artwork.

`artworkProvider`

A handler the system calls to request an [`ArtworkRepresentation`](/documentation/NowPlaying/ArtworkRepresentation) for a specified size.

## Discussion

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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)