Provide a view that controls the currently playing audio from your app.
Using a Now Playing view, users can control current or recently played audio without leaving your app. To add this view, drag it from the library onto your storyboard, even if you’re building the user interface using SwiftUI.
When your app presents the Now Playing view, it immediately displays information about the current audio source, such as another app on the user’s Apple Watch or iPhone. For example, the Now Playing view lets users pause or play music from the Apple Watch’s Music app or control the volume on a podcast from the iPhone’s Podcast app.
The system automatically selects the source. If the user is listening to audio on their watch or phone, the system selects that audio source. Otherwise, the system selects the most recently used source.
Add the View to Your Storyboard
To add the Now Playing view, drag it from the Library to an empty interface controller in your WatchKit app’s storyboard.
Always present the Now Playing view so that it fills the screen in a nonscrolling container. Don’t add any other elements to this scene.
The Now Playing view uses your app’s tint color, but otherwise has no attributes or properties that you can set. In addition, no public interface class exists for the Now Playing view. This means you can’t access or control the view programmatically. Your app just presents the view; the system handles the rest.
Present the View from SwiftUI
When creating a user interface using SwiftUI, you still add the Now Playing view to your storyboard. However, you then use the Identifier from the view’s interface controller to display the view from your SwiftUI code.
To present the Now Playing view:
Drag an interface controller from the library to the storyboard.
In the Attributes Inspector, set the interface controller’s Identifier to a unique string, such as
Drag a Now Playing view into the interface controller.
Present the interface controller from your SwiftUI code.
For example, to add a navigation link to the Now Playing view, you create the link using the
Alternatively, you can add the interface controller to a paged navigation that includes one or more SwiftUI hosting controllers.