Skip to content

Instantly share code, notes, and snippets.

@regularberry
Created September 23, 2020 21:07
Show Gist options
  • Save regularberry/dc6477bd89b772ea513e7f332a89cf6f to your computer and use it in GitHub Desktop.
Save regularberry/dc6477bd89b772ea513e7f332a89cf6f to your computer and use it in GitHub Desktop.
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
CLSDataStore.shared.mainAppContext.descendant(matchingIdentifierPath: [game.identifier]) { context, _ in
guard let activity = context?.currentActivity else { return }
activity.stop()
context?.resignActive()
CLSDataStore.shared.save()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment