The following page explains how to manually show the Add Friend Sheet for GameKit. However, in SwiftUI apps, UIViewControllers aren't used and I can't get the Add Friend sheet to work. What is the most simple way to show the presentFriendRequestCreator from a SwiftUI app?
// Below is the code that shows how to present the add friend sheet, the problem is that I don't have a rootviewController to pass into the function as I'm using SwiftUI.
do { try GKLocalPlayer.local.presentFriendRequestCreator(from: rootViewController!) } catch { print("Error: (error.localizedDescription).") }