I'm implementing Game Center in my game and I present the leaderboards when the user presses a button with this simple bit of code:
let gcViewController = GKGameCenterViewController()
gcViewController.gameCenterDelegate = self
gcViewController.viewState = GKGameCenterViewControllerState.leaderboards
self.present(gcViewController, animated: true, completion: nil)
I've run into the following issue: If the user opens the leaderboards without an Internet connection, the presented view controller just says "No Data". Obviously, this is unavoidable, but then if I gain an Internet connection and re-open the leaderboards, it still says that; I have to restart the app with an Internet connection to see the data. Is there a way to force Game Center to reload its data before presenting a GKGameCenterViewController
?