Contents

addItem(withProductID:completionHandler:)

Adds the item associated with the product identifier to the end of the playlist.

Declaration

func addItem(withProductID productID: String, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
func addItem(withProductID productID: String) async throws

Parameters

  • productID:

    The product identifier for the item to add.

  • completionHandler:

    A block that the system calls after it adds the item to the playlist.

    error

    If an error occurred, this parameter holds the error object that explains the error. Otherwise, the value of this parameter is Nil 227m0.

Discussion

The method adds a single media item associated with the product identifier to the playlist.

See Also

Adding media items to a playlist