There's still some notable gaps in SwiftUI. Especially on tvOS.
It's currently impossible to create a tvOS in pure SwiftUI with streaming video that supports all the picture-in-picture functionality—which is kind of the feature users expect to be "free"
This is because PIP functionality (activate, restore, swap) is based on presenting the AVPlayer view modally… from a view controller. So you have to drop down to UIKit to make it happen and employ a hack to get the UIHostingViewController for a given scene
@neil SFSafariViewController is similarly not-fully bridged on iOS. A Representable wrapper causes double navigation toolbars when using .sheet() and NavigationStack. You need to dip down to the active scene’s root controller to present it using UIKit.
@shawn it gets even weirder with PIP: it’s enabled by default in AVPlayerViewContoller… but only if you have the correct entitlement and have configured the AVAudioSession to allow playback in the background.
@neil but still new enough that the iOS 17 version is the first I’ve felt comfortable making a product with, don’t even get me started on TextEditor or ShareLink. Both are so broken/hobbled it feels like a the SwiftUI team is trolling everyone.
@shawn It's documented in that there's a sample project from WWDC20, but that's all UIKit and not SwiftUI. Also, 90% of SwiftUI blog posts are for iOS. Try to do anything SwiftUI on macOS or tvOS and it quickly because a lesson in dealing with frustration