ios - Check if ViewController was opened with a QuickAction -


how can check if swift app opened quickaction? search solution can inside of viewdidload.

e.g.

override func viewdidload() {       if *vc opened quickaction* == true {           //        else {           // sth else        } } 

thanks help!

when application opened through 3d touch following method in appdelegate called

func application(application: uiapplication, performactionforshortcutitem shortcutitem: uiapplicationshortcutitem, completionhandler: (bool) -> void) {  //navigate required viewcontroller here //yourviewcontroller.isopenedthrough3dtouch = true } 

you can create base class viewcontrollers , declare bool variable isopenedthrough3dtouch

set variable true inside appdelegate callback navigation required viewcontroller initiated, viewdidload knows


Comments