getLastPlayedClipIndex
Introduction
The getLastPlayedClipIndex()
method retrieves the array index of the key plays clip that was most recently played. This function is useful for determining the last clip that was interacted with, which can be leveraged to enhance user experience by, for example, highlighting or resuming playback from the last clip. If no clip has been played yet, the method returns nil
.
Return Value
Return Type | Description | Example |
---|---|---|
Int? | The index of the key plays clip that was most recently played, or nil if no clip has been played. | 2 |
Code Example
if let lastPlayedClipIndex = eventInterface.getLastPlayedClipIndex() {
print("The last played clip index is: \(lastPlayedClipIndex)")
} else {
print("No clip has been played yet.")
}