Skip to content

Instantly share code, notes, and snippets.

@DejanEnspyra
Created February 27, 2018 19:36
Show Gist options
  • Save DejanEnspyra/f250ed680c2f4d90840f17d1e3920e19 to your computer and use it in GitHub Desktop.
Save DejanEnspyra/f250ed680c2f4d90840f17d1e3920e19 to your computer and use it in GitHub Desktop.
Restore Identifier UIViewController (Spotlight)
override func restoreUserActivityState(_ activity: NSUserActivity) {
if activity.activityType == CSSearchableItemActionType, let info = activity.userInfo, let selectedIdentifier = info[CSSearchableItemActivityIdentifier] as? String {
print("Selected Identifier: \(selectedIdentifier)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment