iOS connecting to a AirPlay display

I want to present content from my iOS app to a display (ie SmartTV) via AirPlay. I've searched the Apple doc and have done Google searches, but I can't find any decent examples of how to get started with connecting to a remote display. Everything seems to be either out of date or too small a snippet to be of use (no context as to where the snippet might go in your code).

Can someone please show me how to connect my SwiftUI app to a remote display? It would be greatly appreciated.

Post not yet marked as solved Up vote post of botofogo Down vote post of botofogo
520 views