I'm trying to add a Siri Shortcut to my app which would essentially update the UI in a view controller , but I've got two problems : 1. My app has a tab bar view controller and the activityVC is the third one in the tab bar, but when I run the Siri Shortcut , I get sent to the activityVC ,but without a tab bar 2. When I run the shortcut ,I get transitioned to the activityVC, but updateUI() doesn't run
Here's what I wrote in my app delegate :
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { switch userActivity.activityType { case "start": let sb = UIStoryboard(name: "Main", bundle: nil) let activityVC = sb.instantiateViewController(withIdentifier: Constants.Storyboard.activityVC) as! ActivityViewController let root = UIApplication.shared.keyWindow?.rootViewController root?.present(activityVC, animated: true, completion: nil) activityVC.updateUI() default: print("no shortcut") } return false }