Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PlayerRefreshController 클래스
class PlayerRefreshController {
var players: [String] = []
var gameSession: GameSession
var refreshQueue = DispatchQueue(label: "PlayerRefresh")
internal func refreshPlayers(completion: (() -> Void)? = nil) {
refreshQueue.async {
self.gameSession.allPlayers { players in
self.players = players.map(\.nickname)
completion?()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment