,I want find the right program in playground can use find match () .
@objc final private func findMatch() {
let req = GKMatchRequest()
req.minPlayers = 2
req.maxPlayers = 2
if let vc = GKMatchmakerViewController(matchRequest: req) {
vc.matchmakerDelegate = self
present(vc, animated: true, completion: nil)
} else {
UIAlertController.showError(title: "Go To GameCenter", msg: "Matchmaking failed", vc: self)
}
} I can't use it in struct{} or playground ,it's say can only use in class ,how can I use it in struct ?