Generated from iOS SDK 27.1. Availability is shown on each declaration; permissions and entitlements still apply.
Functions and constants
get · iOS 15.0+moreInGenre
TypeScriptstatic get moreInGenre(): MusicRelationshipProperty<MusicVideo, MusicVideo>
Swift declarationstatic let moreInGenre: MusicRelationshipProperty<MusicVideo, MusicVideo>
A identifier of the association property that returns
a collection of music videos in the same genre as this music video.
get · iOS 15.0+moreByArtist
TypeScriptstatic get moreByArtist(): MusicRelationshipProperty<MusicVideo, MusicVideo>
Swift declarationstatic let moreByArtist: MusicRelationshipProperty<MusicVideo, MusicVideo>
An identifier of the association property that returns
a collection of additional music videos by the artist.
get · iOS 15.0+songs
TypeScriptstatic get songs(): MusicRelationshipProperty<MusicVideo, Song>
Swift declarationstatic let songs: MusicRelationshipProperty<MusicVideo, Song>
An identifier of the relationship property that returns
the associated songs for the music video.
get · iOS 15.0+albums
TypeScriptstatic get albums(): MusicRelationshipProperty<MusicVideo, Album>
Swift declarationstatic let albums: MusicRelationshipProperty<MusicVideo, Album>
An identifier of the relationship property that returns
the associated albums for the music video.
get · iOS 15.0+genres
TypeScriptstatic get genres(): MusicRelationshipProperty<MusicVideo, Genre>
Swift declarationstatic let genres: MusicRelationshipProperty<MusicVideo, Genre>
An identifier of the relationship property that returns
the associated genres for the music video.
get · iOS 15.0+artists
TypeScriptstatic get artists(): MusicRelationshipProperty<MusicVideo, Artist>
Swift declarationstatic let artists: MusicRelationshipProperty<MusicVideo, Artist>
An identifier of the relationship property that returns
the associated artists for the music video.
get · iOS 15.0+artistURL
TypeScriptstatic get artistURL(): MusicExtendedAttributeProperty<MusicVideo, string>
Swift declarationstatic var artistURL: MusicExtendedAttributeProperty<MusicVideo, URL> { get }
An identifier for the extended attribute property that returns
the artist’s URL.
get · iOS 15.0+topReleases
TypeScriptstatic get topReleases(): MusicRelationshipProperty<RecordLabel, Album>
Swift declarationstatic var topReleases: MusicRelationshipProperty<RecordLabel, Album> { get }
An identifier for the association property that returns
a collection of top releases for the record label.
get · iOS 15.0+latestReleases
TypeScriptstatic get latestReleases(): MusicRelationshipProperty<RecordLabel, Album>
Swift declarationstatic var latestReleases: MusicRelationshipProperty<RecordLabel, Album> { get }
An identifier for the association property that returns
a collection of the most recent releases for the record label.
get · iOS 15.0+musicVideos
TypeScriptstatic get musicVideos(): MusicRelationshipProperty<Song, MusicVideo>
Swift declarationstatic let musicVideos: MusicRelationshipProperty<Song, MusicVideo>
An identifier for the relationship property that returns
the song’s associated music videos.
get · iOS 16.0+audioVariants
TypeScriptstatic get audioVariants(): MusicExtendedAttributeProperty<Song, Array<AudioVariant>>
Swift declarationstatic let audioVariants: MusicExtendedAttributeProperty<Song, [AudioVariant]>
An identifier for the extended attribute property that returns
the audio variants for the song.
get · iOS 15.0+albums
TypeScriptstatic get albums21855(): MusicRelationshipProperty<Song, Album>
Swift declarationstatic let albums: MusicRelationshipProperty<Song, Album>
An identifier for the relationship property that returns
the associated albums for the song.
get · iOS 15.0+genres
TypeScriptstatic get genres24911(): MusicRelationshipProperty<Song, Genre>
Swift declarationstatic let genres: MusicRelationshipProperty<Song, Genre>
An identifier for the relationship property that returns
the associated genres for the song.
get · iOS 15.0+artists
TypeScriptstatic get artists81815(): MusicRelationshipProperty<Song, Artist>
Swift declarationstatic let artists: MusicRelationshipProperty<Song, Artist>
An identifier for the relationship property that returns
the associated artists for the song.
get · iOS 15.0+station
TypeScriptstatic get station(): MusicRelationshipProperty<Song, Station>
Swift declarationstatic let station: MusicRelationshipProperty<Song, Station>
An identifier for the relationship property that returns
the associated station for the song.
get · iOS 15.0+artistURL
TypeScriptstatic get artistURL46360(): MusicExtendedAttributeProperty<Song, string>
Swift declarationstatic var artistURL: MusicExtendedAttributeProperty<Song, URL> { get }
An identifier for the extended attribute property that returns
the artist’s URL.
get · iOS 15.0+composers
TypeScriptstatic get composers(): MusicRelationshipProperty<Song, Artist>
Swift declarationstatic let composers: MusicRelationshipProperty<Song, Artist>
An identifier for the relationship property that returns
the song’s composers.
get · iOS 15.0+recordLabels
TypeScriptstatic get recordLabels(): MusicRelationshipProperty<Album, RecordLabel>
Swift declarationstatic let recordLabels: MusicRelationshipProperty<Album, RecordLabel>
An identifier for the relationship property that returns
the record labels for the album.
get · iOS 16.0+audioVariants
TypeScriptstatic get audioVariants78766(): MusicExtendedAttributeProperty<Album, Array<AudioVariant>>
Swift declarationstatic let audioVariants: MusicExtendedAttributeProperty<Album, [AudioVariant]>
An identifier for the extended attribute property that returns
the audio variants for the album.
get · iOS 15.0+otherVersions
TypeScriptstatic get otherVersions(): MusicRelationshipProperty<Album, Album>
Swift declarationstatic let otherVersions: MusicRelationshipProperty<Album, Album>
An identifier for the association property that returns
a collection of other versions of the album.
get · iOS 15.0+relatedAlbums
TypeScriptstatic get relatedAlbums(): MusicRelationshipProperty<Album, Album>
Swift declarationstatic let relatedAlbums: MusicRelationshipProperty<Album, Album>
An identifier for the association property that returns
a collection of related albums.
get · iOS 15.0+relatedVideos
TypeScriptstatic get relatedVideos(): MusicRelationshipProperty<Album, MusicVideo>
Swift declarationstatic let relatedVideos: MusicRelationshipProperty<Album, MusicVideo>
An identifier for the association property that returns
a collection of related music videos for the album.
get · iOS 15.0+genres
TypeScriptstatic get genres44382(): MusicRelationshipProperty<Album, Genre>
Swift declarationstatic let genres: MusicRelationshipProperty<Album, Genre>
An identifier for the relationship property that returns
the genres for the album.
get · iOS 15.0+tracks
TypeScriptstatic get tracks(): MusicRelationshipProperty<Album, Track>
Swift declarationstatic let tracks: MusicRelationshipProperty<Album, Track>
An identifier for the relationship property that returns
the tracks on the album.
get · iOS 15.0+artists
TypeScriptstatic get artists87718(): MusicRelationshipProperty<Album, Artist>
Swift declarationstatic let artists: MusicRelationshipProperty<Album, Artist>
An identifier for the relationship property that returns
the associated artists for the album.
get · iOS 15.0+appearsOn
TypeScriptstatic get appearsOn(): MusicRelationshipProperty<Album, Playlist>
Swift declarationstatic let appearsOn: MusicRelationshipProperty<Album, Playlist>
An identifier for the association property that returns
a collection of playlists that include tracks from the album.
get · iOS 15.0+artistURL
TypeScriptstatic get artistURL54785(): MusicExtendedAttributeProperty<Album, string>
Swift declarationstatic var artistURL: MusicExtendedAttributeProperty<Album, URL> { get }
An identifier for the extended attribute property that returns
the artist’s URL.
get · iOS 15.0+topMusicVideos
TypeScriptstatic get topMusicVideos(): MusicRelationshipProperty<Artist, MusicVideo>
Swift declarationstatic let topMusicVideos: MusicRelationshipProperty<Artist, MusicVideo>
An identifier for the association property that returns
a collection of the artist’s top music videos.
get · iOS 15.0+fullAlbums
TypeScriptstatic get fullAlbums(): MusicRelationshipProperty<Artist, Album>
Swift declarationstatic let fullAlbums: MusicRelationshipProperty<Artist, Album>
An identifier for the association property that returns
a collection of the artist’s full-release albums.
get · iOS 15.0+liveAlbums
TypeScriptstatic get liveAlbums(): MusicRelationshipProperty<Artist, Album>
Swift declarationstatic let liveAlbums: MusicRelationshipProperty<Artist, Album>
An identifier for the association property that returns
a collection of the artist’s live albums.
get · iOS 15.0+musicVideos
TypeScriptstatic get musicVideos97853(): MusicRelationshipProperty<Artist, MusicVideo>
Swift declarationstatic let musicVideos: MusicRelationshipProperty<Artist, MusicVideo>
An identifier for the relationship property that returns
the associated music videos for the artist.
get · iOS 15.0+latestRelease
TypeScriptstatic get latestRelease(): MusicRelationshipProperty<Artist, Album>
Swift declarationstatic let latestRelease: MusicRelationshipProperty<Artist, Album>
An identifier for the association property that returns
the artist’s most recent album.
get · iOS 15.0+featuredAlbums
TypeScriptstatic get featuredAlbums(): MusicRelationshipProperty<Artist, Album>
Swift declarationstatic let featuredAlbums: MusicRelationshipProperty<Artist, Album>
An identifier for the association property that returns
a collection of featured albums for the artist.
get · iOS 15.0+similarArtists
TypeScriptstatic get similarArtists(): MusicRelationshipProperty<Artist, Artist>
Swift declarationstatic let similarArtists: MusicRelationshipProperty<Artist, Artist>
An identifier for the association property that returns
a collection of artists similar to this artist.
get · iOS 15.0+appearsOnAlbums
TypeScriptstatic get appearsOnAlbums(): MusicRelationshipProperty<Artist, Album>
Swift declarationstatic let appearsOnAlbums: MusicRelationshipProperty<Artist, Album>
An identifier for the association property that returns
a collection of albums from other artists that this artist appears on.
get · iOS 15.0+compilationAlbums
TypeScriptstatic get compilationAlbums(): MusicRelationshipProperty<Artist, Album>
Swift declarationstatic let compilationAlbums: MusicRelationshipProperty<Artist, Album>
An identifier for the association property that returns
a collection of compilation albums that include tracks by the artist.
get · iOS 15.0+featuredPlaylists
TypeScriptstatic get featuredPlaylists(): MusicRelationshipProperty<Artist, Playlist>
Swift declarationstatic let featuredPlaylists: MusicRelationshipProperty<Artist, Playlist>
An identifier for the association property that returns
a collection of the artist’s playlists.
get · iOS 15.0+albums
TypeScriptstatic get albums25743(): MusicRelationshipProperty<Artist, Album>
Swift declarationstatic let albums: MusicRelationshipProperty<Artist, Album>
An identifier for the relationship property that returns
the associated albums for the artist.
get · iOS 15.0+genres
TypeScriptstatic get genres2815(): MusicRelationshipProperty<Artist, Genre>
Swift declarationstatic let genres: MusicRelationshipProperty<Artist, Genre>
An identifier for the relationship property that returns
the associated genres for the artist.
get · iOS 15.0+singles
TypeScriptstatic get singles(): MusicRelationshipProperty<Artist, Album>
Swift declarationstatic let singles: MusicRelationshipProperty<Artist, Album>
An identifier of the association property that returns
a collection of the artist’s albums in the _singles_ category.
get · iOS 15.0+station
TypeScriptstatic get station25427(): MusicRelationshipProperty<Artist, Station>
Swift declarationstatic let station: MusicRelationshipProperty<Artist, Station>
An identifier for the relationship property that returns
the associated station for the artist.
get · iOS 15.0+topSongs
TypeScriptstatic get topSongs(): MusicRelationshipProperty<Artist, Song>
Swift declarationstatic let topSongs: MusicRelationshipProperty<Artist, Song>
An identifier for the association property that returns
a collection of the artist’s top songs.
get · iOS 15.0+playlists
TypeScriptstatic get playlists(): MusicRelationshipProperty<Artist, Playlist>
Swift declarationstatic let playlists: MusicRelationshipProperty<Artist, Playlist>
An identifier for the relationship property that returns
the associated playlists for the artist.
get · iOS 15.4+playlists
TypeScriptstatic get playlists77177(): MusicRelationshipProperty<Curator, Playlist>
Swift declarationstatic let playlists: MusicRelationshipProperty<Curator, Playlist>
An identifier for the relationship property that returns
the associated playlists for the curator.
get · iOS 15.0+moreByCurator
TypeScriptstatic get moreByCurator(): MusicRelationshipProperty<Playlist, Playlist>
Swift declarationstatic let moreByCurator: MusicRelationshipProperty<Playlist, Playlist>
An identifier for the association property that returns
a collection of additional playlists by the same curator.
get · iOS 15.0+featuredArtists
TypeScriptstatic get featuredArtists(): MusicRelationshipProperty<Playlist, Artist>
Swift declarationstatic let featuredArtists: MusicRelationshipProperty<Playlist, Artist>
An identifier for the association property that returns
a collection of featured artists for this playlist.
get · iOS 15.0+tracks
TypeScriptstatic get tracks46457(): MusicRelationshipProperty<Playlist, Track>
Swift declarationstatic let tracks: MusicRelationshipProperty<Playlist, Track>
An identifier for the relationship property that returns
the tracks in the playlist.
get · iOS 16.0+curator
TypeScriptstatic get curator(): MusicRelationshipProperty<Playlist, Curator>
Swift declarationstatic let curator: MusicRelationshipProperty<Playlist, Curator>
An identifier for the extended attribute property that returns
the playlist’s associated curator.
get · iOS 16.0+entries
TypeScriptstatic get entries(): MusicRelationshipProperty<Playlist, Playlist_Entry>
Swift declarationstatic let entries: MusicRelationshipProperty<Playlist, Playlist.Entry>
An identifier for the relationship property that returns
the entries in the playlist.
get · iOS 16.0+radioShow
TypeScriptstatic get radioShow(): MusicRelationshipProperty<Playlist, RadioShow>
Swift declarationstatic let radioShow: MusicRelationshipProperty<Playlist, RadioShow>
An identifier for the extended attribute property that returns
the playlist’s associated radio show.
get · iOS 15.4+playlists
TypeScriptstatic get playlists53095(): MusicRelationshipProperty<RadioShow, Playlist>
Swift declarationstatic let playlists: MusicRelationshipProperty<RadioShow, Playlist>
An identifier for the relationship property that returns
the associated playlists for the radio show.
get · iOS 16.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+id
TypeScriptget id(): string
Swift declarationlet id: String
The unique identifier for the catalog chart.
get · iOS 16.0+kind
TypeScriptget kind(): MusicCatalogChartKind
Swift declarationlet kind: MusicCatalogChartKind
The kind of catalog chart.
get · iOS 16.0+items
TypeScriptget items(): MusicItemCollection<SDKHandle>
Swift declarationlet items: MusicItemCollection<MusicItemType>
The items for the catalog chart.
get · iOS 16.0+title
TypeScriptget title(): string
Swift declarationlet title: String
The title for the catalog chart.
get · iOS 15.0+startIndex
TypeScriptget startIndex(): SDKHandle
Swift declarationvar startIndex: MusicItemCollection<MusicItemType>.Index { get }
The position of the first element in a nonempty collection.
If the collection is empty, `startIndex` is equal to `endIndex`.
get · iOS 15.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 15.0+hasNextBatch
TypeScriptget hasNextBatch(): boolean
Swift declarationvar hasNextBatch: Bool { get }
A Boolean value that indicates whether the collection has information
that allows it to fetch a subsequent batch of items.
get · iOS 15.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
method · iOS 15.0+index
TypeScriptindexAfter(i: SDKHandle): SDKHandle
Swift declarationfunc index(after i: MusicItemCollection<MusicItemType>.Index) -> MusicItemCollection<MusicItemType>.Index
Returns the position immediately after the given index.
The successor of an index must be well defined. For an index `i` into a
collection `c`, calling `c.index(after: i)` returns the same index every
time.
- Parameter i: A valid index of the collection. `i` must be less than
`endIndex`.
- Returns: The index value immediately after `i`.
method · iOS 15.0+index
TypeScriptindexBefore(i: SDKHandle): SDKHandle
Swift declarationfunc index(before i: MusicItemCollection<MusicItemType>.Index) -> MusicItemCollection<MusicItemType>.Index
Returns the position immediately before the given index.
- Parameter i: A valid index of the collection. `i` must be greater than
`startIndex`.
- Returns: The index value immediately before `i`.
method · iOS 15.0+index
TypeScriptindexOffsetByLimitedBy(i: SDKHandle, distance: number, limit: SDKHandle): (SDKHandle) | null
Swift declarationfunc index(_ i: MusicItemCollection<MusicItemType>.Index, offsetBy distance: Int, limitedBy limit: MusicItemCollection<MusicItemType>.Index) -> MusicItemCollection<MusicItemType>.Index?
Returns an index that is the specified distance from the given index,
unless that distance is beyond a given limiting index.
The following example obtains an index advanced four positions from a
string's starting index and then prints the character at that position.
The operation doesn't require going beyond the limiting `s.endIndex`
value, so it succeeds.
let s = "Swift"
if let i = s.index(s.startIndex, offsetBy: 4, limitedBy: s.endIndex) {
print(s[i])
}
// Prints "t"
The next example attempts to retrieve an index six positions from
`s.startIndex` but fails, because that distance is beyond the index
passed as `limit`.
let j = s.index(s.startIndex, offsetBy: 6, limitedBy: s.endIndex)
print(j)
// Prints "nil"
The value passed as `distance` must not offset `i` beyond the bounds of
the collection, unless the index passed as `limit` prevents offsetting
beyond those bounds.
- Parameters:
- i: A valid index of the collection.
- distance: The distance to offset `i`. `distance` must not be negative
unless the collection conforms to the `BidirectionalCollection`
protocol.
- limit: A valid index of the collection to use as a limit. If
`distance > 0`, a limit that is less than `i` has no effect.
Likewise, if `distance < 0`, a limit that is greater than `i` has no
effect.
- Returns: An index offset by `distance` from the index `i`, unless that
index would be beyond `limit` in the direction of movement. In that
case, the method returns `nil`.
- Complexity: O(1)
method · iOS 15.0+index
TypeScriptindexOffsetBy(i: SDKHandle, distance: number): SDKHandle
Swift declarationfunc index(_ i: MusicItemCollection<MusicItemType>.Index, offsetBy distance: Int) -> MusicItemCollection<MusicItemType>.Index
Returns an index that is the specified distance from the given index.
The following example obtains an index advanced four positions from a
string's starting index and then prints the character at that position.
let s = "Swift"
let i = s.index(s.startIndex, offsetBy: 4)
print(s[i])
// Prints "t"
The value passed as `distance` must not offset `i` beyond the bounds of
the collection.
- Parameters:
- i: A valid index of the collection.
- distance: The distance to offset `i`. `distance` must not be negative
unless the collection conforms to the `BidirectionalCollection`
protocol.
- Returns: An index offset by `distance` from the index `i`. If
`distance` is positive, this is the same value as the result of
`distance` calls to `index(after:)`. If `distance` is negative, this
is the same value as the result of `abs(distance)` calls to
`index(before:)`.
- Complexity: O(1)
get · iOS 15.0+title
TypeScriptget title(): (string) | null
Swift declarationvar title: String? { get }
An optional title for the collection.
Collections that represent an association from a music item
often contain a title.
get · iOS 15.0+indices
TypeScriptget indices(): SDKHandle
Swift declarationvar indices: MusicItemCollection<MusicItemType>.Indices { get }
The indices that are valid for subscripting the collection, in ascending
order.
A collection's `indices` property can hold a strong reference to the
collection itself, causing the collection to be nonuniquely referenced.
If you mutate the collection while iterating over its indices, a strong
reference can result in an unexpected copy of the collection. To avoid
the unexpected copy, use the `index(after:)` method starting with
`startIndex` to produce indices instead.
var c = MyFancyCollection([10, 20, 30, 40, 50])
var i = c.startIndex
while i != c.endIndex {
c[i] /= 5
i = c.index(after: i)
}
// c == MyFancyCollection([2, 4, 6, 8, 10])
method · iOS 15.0+distance
TypeScriptdistance(start: SDKHandle, end: SDKHandle): number
Swift declarationfunc distance(from start: MusicItemCollection<MusicItemType>.Index, to end: MusicItemCollection<MusicItemType>.Index) -> Int
Returns the distance between two indices.
Unless the collection conforms to the `BidirectionalCollection` protocol,
`start` must be less than or equal to `end`.
- Parameters:
- start: A valid index of the collection.
- end: Another valid index of the collection. If `end` is equal to
`start`, the result is zero.
- Returns: The distance between `start` and `end`. The result can be
negative only if the collection conforms to the
`BidirectionalCollection` protocol.
- Complexity: O(1)
get · iOS 15.0+endIndex
TypeScriptget endIndex(): SDKHandle
Swift declarationvar endIndex: MusicItemCollection<MusicItemType>.Index { get }
The collection's "past the end" position---that is, the position one
greater than the last valid subscript argument.
When you need a range that includes the last element of a collection, use
the half-open range operator (`..<`) with `endIndex`. The `..<` operator
creates a range that doesn't include the upper bound, so it's always
safe to use with `endIndex`. For example:
let numbers = [10, 20, 30, 40, 50]
if let index = numbers.firstIndex(of: 30) {
print(numbers[index ..< numbers.endIndex])
}
// Prints "[30, 40, 50]"
If the collection is empty, `endIndex` is equal to `startIndex`.
method · iOS 15.0+formIndex
TypeScriptformIndexAfter(i: SDKHandle): { $ret: null; $out: { "i": SDKHandle } }
Swift declarationfunc formIndex(after i: inout MusicItemCollection<MusicItemType>.Index)
Replaces the given index with its successor.
- Parameter i: A valid index of the collection. `i` must be less than
`endIndex`.
Omit the output parameters from the call. The result contains $ret and $out, with i inside $out.
method · iOS 15.0+formIndex
TypeScriptformIndexBefore(i: SDKHandle): { $ret: null; $out: { "i": SDKHandle } }
Swift declarationfunc formIndex(before i: inout MusicItemCollection<MusicItemType>.Index)
Replaces the given index with its predecessor.
- Parameter i: A valid index of the collection. `i` must be greater than
`startIndex`.
Omit the output parameters from the call. The result contains $ret and $out, with i inside $out.
method · iOS 15.0+nextBatch
TypeScriptnextBatch(limit?: (number) | null): Promise<(MusicItemCollection<SDKHandle>) | null>
Swift declarationfunc nextBatch(limit: Int? = nil) async throws -> MusicItemCollection<MusicItemType>?
Fetches the next batch of items asynchronously.
This method returns the next batch of items as another collection of
music items of the same type.
subscript · iOS 15.0+subscript
TypeScriptsubscript(bounds: SDKHandle): SDKHandle
Swift declarationsubscript(bounds: Range<MusicItemCollection<MusicItemType>.Index>) -> MusicItemCollection<MusicItemType>.SubSequence { get }
Accesses a contiguous subrange of the collection's elements.
The accessed slice uses the same indices for the same elements as the
original collection uses. Always use the slice's `startIndex` property
instead of assuming that its indices start at a particular value.
This example demonstrates getting a slice of an array of strings, finding
the index of one of the strings in the slice, and then using that index
in the original array.
let streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"]
let streetsSlice = streets[2 ..< streets.endIndex]
print(streetsSlice)
// Prints "["Channing", "Douglas", "Evarts"]"
let index = streetsSlice.firstIndex(of: "Evarts") // 4
print(streets[index!])
// Prints "Evarts"
- Parameter bounds: A range of the collection's indices. The bounds of
the range must be valid indices of the collection.
- Complexity: O(1)
subscript · iOS 15.0+subscript
TypeScriptsubscript53869(position: SDKHandle): SDKHandle
Swift declarationsubscript(position: MusicItemCollection<MusicItemType>.Index) -> MusicItemCollection<MusicItemType>.Element { get }
Accesses the element at the specified position.
The following example accesses an element of an array through its
subscript to print its value:
var streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"]
print(streets[1])
// Prints "Bryant"
You can subscript a collection with any valid index other than the
collection's end index. The end index refers to the position one past
the last element of a collection, so it doesn't correspond with an
element.
- Parameter position: The position of the element to access. `position`
must be a valid index of the collection that is not equal to the
`endIndex` property.
- Complexity: O(1)
get · iOS 16.0+includeOnlyDownloadedContent
TypeScriptget includeOnlyDownloadedContent(): boolean
Swift declarationvar includeOnlyDownloadedContent: Bool
A Boolean value that indicates whether the library response
should only include items downloaded on the user’s device.
set · iOS 16.0+includeOnlyDownloadedContent
TypeScriptset includeOnlyDownloadedContent(value: boolean)
Swift declarationvar includeOnlyDownloadedContent: Bool
A Boolean value that indicates whether the library response
should only include items downloaded on the user’s device.
get · iOS 16.0+limit
TypeScriptget limit(): number
Swift declarationvar limit: Int
A limit for the number of items to return in the library response.
A limit of 0 length means no limit.
set · iOS 16.0+limit
TypeScriptset limit(value: number)
Swift declarationvar limit: Int
A limit for the number of items to return in the library response.
A limit of 0 length means no limit.
method · iOS 16.0+filter
TypeScriptfilter(text: string): void
Swift declarationmutating func filter(text: String)
Filters items by a specific string.
get · iOS 16.0+offset
TypeScriptget offset(): number
Swift declarationvar offset: Int
An offset for the request.
set · iOS 16.0+offset
TypeScriptset offset(value: number)
Swift declarationvar offset: Int
An offset for the request.
method · iOS 16.0+response
TypeScriptresponse(): Promise<MusicLibraryResponse<SDKHandle>>
Swift declarationfunc response() async throws -> MusicLibraryResponse<MusicItemType>
Fetches items from the user’s music library.
get · iOS 16.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+id
TypeScriptget id(): MusicItemID
Swift declarationvar id: MusicItemID { get }
The stable identity of the entity associated with this instance.
get · iOS 16.0+items
TypeScriptget items(): MusicItemCollection<SDKHandle>
Swift declarationlet items: MusicItemCollection<MusicItemType>
A collection of items that correspond to the children of the section.
get · iOS 16.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+items
TypeScriptget items(): MusicItemCollection<SDKHandle>
Swift declarationlet items: MusicItemCollection<MusicItemType>
A collection of items that match the filters on the originating library request.
get · iOS 15.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 15.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 16.0+limit
TypeScriptget limit(): (number) | null
Swift declarationvar limit: Int?
A limit for the number of items to return
in the response that contains items the user has recently played.
set · iOS 16.0+limit
TypeScriptset limit(value: (number) | null)
Swift declarationvar limit: Int?
A limit for the number of items to return
in the response that contains items the user has recently played.
get · iOS 16.0+offset
TypeScriptget offset(): (number) | null
Swift declarationvar offset: Int?
An offset for the request.
set · iOS 16.0+offset
TypeScriptset offset(value: (number) | null)
Swift declarationvar offset: Int?
An offset for the request.
method · iOS 16.0+response
TypeScriptresponse(): Promise<MusicRecentlyPlayedResponse<SDKHandle>>
Swift declarationfunc response() async throws -> MusicRecentlyPlayedResponse<MusicItemType>
Fetches items the user has recently played.
get · iOS 15.0+properties
TypeScriptget properties(): Array<PartialMusicAsyncProperty<SDKHandle>>
Swift declarationvar properties: [PartialMusicAsyncProperty<MusicItemType>]
A list of properties which the resource request will fetch
for each music item in the response.
set · iOS 15.0+properties
TypeScriptset properties(value: Array<PartialMusicAsyncProperty<SDKHandle>>)
Swift declarationvar properties: [PartialMusicAsyncProperty<MusicItemType>]
A list of properties which the resource request will fetch
for each music item in the response.
get · iOS 15.0+limit
TypeScriptget limit(): (number) | null
Swift declarationvar limit: Int?
A limit for the number of items to return
in the catalog resource response.
set · iOS 15.0+limit
TypeScriptset limit(value: (number) | null)
Swift declarationvar limit: Int?
A limit for the number of items to return
in the catalog resource response.
get · iOS 26.4+options
TypeScriptget options(): Array<MusicCatalogResourceRequestOption>
Swift declarationvar options: [MusicCatalogResourceRequestOption]
Additional options to use for this request.
set · iOS 26.4+options
TypeScriptset options(value: Array<MusicCatalogResourceRequestOption>)
Swift declarationvar options: [MusicCatalogResourceRequestOption]
Additional options to use for this request.
method · iOS 15.0+response
TypeScriptresponse(): Promise<MusicCatalogResourceResponse<SDKHandle>>
Swift declarationfunc response() async throws -> MusicCatalogResourceResponse<MusicItemType>
Fetches items from the Apple Music catalog that match a specific filter.
get · iOS 16.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+items
TypeScriptget items(): MusicItemCollection<SDKHandle>
Swift declarationlet items: MusicItemCollection<MusicItemType>
A collection of items the user has recently played.
get · iOS 15.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 15.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 15.0+items
TypeScriptget items(): MusicItemCollection<SDKHandle>
Swift declarationlet items: MusicItemCollection<MusicItemType>
A collection of items matching the filter used in
the originating ``MusicCatalogResourceRequest``.
method · iOS 16.0+filterItems
TypeScriptfilterItems(text: string): void
Swift declarationmutating func filterItems(text: String)
Filters items by a specific string.
get · iOS 16.0+includeOnlyDownloadedContent
TypeScriptget includeOnlyDownloadedContent(): boolean
Swift declarationvar includeOnlyDownloadedContent: Bool
A Boolean value that indicates whether the library response
should only include items downloaded on the user’s device.
set · iOS 16.0+includeOnlyDownloadedContent
TypeScriptset includeOnlyDownloadedContent(value: boolean)
Swift declarationvar includeOnlyDownloadedContent: Bool
A Boolean value that indicates whether the library response
should only include items downloaded on the user’s device.
get · iOS 16.0+limit
TypeScriptget limit(): number
Swift declarationvar limit: Int
A limit for the number of items to return in the library response.
A limit of 0 length means no limit.
set · iOS 16.0+limit
TypeScriptset limit(value: number)
Swift declarationvar limit: Int
A limit for the number of items to return in the library response.
A limit of 0 length means no limit.
get · iOS 16.0+offset
TypeScriptget offset(): number
Swift declarationvar offset: Int
An offset for the request.
set · iOS 16.0+offset
TypeScriptset offset(value: number)
Swift declarationvar offset: Int
An offset for the request.
method · iOS 16.0+response
TypeScriptresponse(): Promise<MusicLibrarySectionedResponse<SDKHandle, SDKHandle>>
Swift declarationfunc response() async throws -> MusicLibrarySectionedResponse<SectionType, MusicItemType>
Fetches items grouped by sections from the user’s music library.
get · iOS 16.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 16.0+debugDescription
TypeScriptget debugDescription(): string
Swift declarationvar debugDescription: String { get }
A textual representation of this instance, suitable for debugging.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(reflecting:)`
initializer. This initializer works with any type, and uses the custom
`debugDescription` property for types that conform to
`CustomDebugStringConvertible`:
struct Point: CustomDebugStringConvertible {
let x: Int, y: Int
var debugDescription: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(reflecting: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `debugDescription` property.
get · iOS 16.0+sections
TypeScriptget sections(): Array<MusicLibrarySection<SDKHandle, SDKHandle>>
Swift declarationlet sections: [MusicLibrarySection<SectionType, MusicItemType>]
An array of sections that match the filters on the originating library request.
get · iOS 15.0+description
TypeScriptget description(): string
Swift declarationvar description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.