Search code examples
iosswiftxcodeswiftuiwatchos

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


Solution

  • 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