Instance Property

mediaPlayPauseButtonFrame

The frame rectangle to use for displaying a media playback button.

Declaration

optional var mediaPlayPauseButtonFrame: CGRect { get }

Discussion

If you support the playback of media directly from your notification interface, implement this property and use it to return a nonempty rectangle specified in the coordinate system of your view controller’s view. The system draws a button in the provided rectangle that lets the user play and pause your media content. The system handles the drawing of the button for you and calls the mediaPlay() and mediaPause() methods in response to user interactions. You can place this button anywhere in your view controller’s view.

If you don't implement this property, the system doesn't draw a media playback button.

See Also

Supporting Media Playback

enum UNNotificationContentExtensionMediaPlayPauseButtonType

Constants indicating the type of media button to display.

var mediaPlayPauseButtonTintColor: UIColor

The tint color for the media playback button.

func mediaPlay()

Tells you to begin playback of your media content.

func mediaPause()

Tells you to pause playback of your media content.