如何从SKScene解雇GKTurnBasedMatchmakerViewController

时间:2017-10-18 20:52:19

标签: swift gamekit skscene

创建比赛后如何解除GKTurnBasedMatchmakerViewController?可用的代理似乎仅适用于出现错误的情况。曾经有一个名为didFind,但由于它被弃用,我很难弄清楚如何在创建比赛或玩家点击现有比赛时解雇它。

receivedTurnEventFor是唯一的跟进电话,它没有引用匹配器视图控制器。

我正在GKTurnBasedMatchmakerViewController通过

加载SKView
let viewController = self.view?.window?.rootViewController
        let vc = GKTurnBasedMatchmakerViewController(matchRequest: r)
        vc.turnBasedMatchmakerDelegate = self
        viewController?.present(vc, animated: true, completion: {
            print("launched GKTurnBasedMatchmakerViewController")
        })

1 个答案:

答案 0 :(得分:0)

添加

self.presentedViewController?.dismiss(animated: true, completion: nil)
播放器中的

(_:receivedTurnEventFor:didBecomeActive:)