I am using two real iPhones (A and B) to test game center "Invite" logic and I am getting confused.
I use iPhone-A to start my game and then launch the GKMatchmakerViewController. I then select the "Invite Friends" button and select a friend to invite (which is iPhone-B).
On iPhone-B, I receive a popup message asking whether I want to join the game. After I click the popup message, I see my game is launched on iPhone-B. At this point, I assume the player( player: didAccept invite:) function would be called on iPhone-B automatically and then a GKMatchmakerViewController should be created by providing the GKInvite object by calling the function below:
let mmvc = GKMatchmakerViewController(invite: inviteToAccept)
mmvc!.matchmakerDelegate = self
viewController.present(mmvc!, animated: true, completion: nil)
Where does the "viewController" comes from to allow me to present/display the GKMatchmakerViewController?
Can someone explain how they present the GKMatchmakerViewController when the didAccept function is called?