---
title: CPNowPlayingShuffleButton
framework: carplay
role: symbol
role_heading: Class
path: carplay/cpnowplayingshufflebutton
---

# CPNowPlayingShuffleButton

A button for cycling through the available shuffle modes.

## Declaration

```swift
@MainActor class CPNowPlayingShuffleButton
```

## Overview

Overview CPNowPlayingShuffleButton is a concrete subclass of CPNowPlayingButton. Use the button’s handler to invoke your existing functionality for cycling through shuffle modes, using the same MPChangeShuffleModeCommand that you provide to MPRemoteCommandCenter. CarPlay uses MPRemoteCommandCenter to observe changes to the shuffle mode and updates the button’s appearance accordingly.

## Relationships

### Inherits From

- [CPNowPlayingButton](carplay/cpnowplayingbutton.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Managing the Template’s Buttons

- [nowPlayingButtons](carplay/cpnowplayingtemplate/nowplayingbuttons.md)
- [updateNowPlayingButtons(_:)](carplay/cpnowplayingtemplate/updatenowplayingbuttons(_:).md)
- [CPNowPlayingButton](carplay/cpnowplayingbutton.md)
- [CPNowPlayingImageButton](carplay/cpnowplayingimagebutton.md)
- [CPNowPlayingAddToLibraryButton](carplay/cpnowplayingaddtolibrarybutton.md)
- [CPNowPlayingMoreButton](carplay/cpnowplayingmorebutton.md)
- [CPNowPlayingPlaybackRateButton](carplay/cpnowplayingplaybackratebutton.md)
- [CPNowPlayingRepeatButton](carplay/cpnowplayingrepeatbutton.md)
