Antoni277
Antoni277

Reputation: 3

SwiftUI - watchOS NowPlayingView

I already created my Apple Watch music app with background sound in SwiftUI. I want to somehow present NowPlayigView. The only thing I found on the Apple Developer website about it is in the attached picture. Maybe the solution is very simple, but I can't find it. Please help. Image

https://developer.apple.com/documentation/watchkit/storyboard_support/adding_a_now_playing_view

Upvotes: 0

Views: 1070

Answers (2)

Drew Westcott
Drew Westcott

Reputation: 566

@Antoni277 I believe you also have to provide meta data about what your App is playing for it to show in any Now Playing screen. For instance your code will have to provide a instance of MPNowPlayingInfoCenter.

Have a look at the documentation at Becoming a Now Playable App

Upvotes: 0

lorem ipsum
lorem ipsum

Reputation: 29242

Just put

NowPlayingView() where you want it.

Oh and make sure you import WatchKit.

Apple talks about it at about minute 15:40 in Build a workout App for Apple Watch

Upvotes: 3

Related Questions