I am trying to implement 3d Touch and I want to navigate to a specific viewController in a Master - Detail app.
The viewController I am aiming to get to is the third controller in the hierarchy:
MasterViewController ----> SettingsViewController ----> ThirdViewController
I can access the ThirdViewController in normal operation through TabBarItem (connected via segue to SettingsViewController right from the IB) and then via a UIButton (connected via segue to ThirdViewController right from the IB) to the ThirdViewController.
i.e in MasterViewController ---> (tap barButtonItem) ----> SettingsViewControler ----> (tap uiButton) ---> ThirdViewController.
I have already amended the info.plist and 3D touch works fine and can call my action:
func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void) {
var shortcutDictionary = shortcutItem.userInfo;
let shortcutString1 = shortcutDictionary!["key1"] as! String
if (shortcutString1 == "value1") {
// how do i get from here to the settingsController??
}
}
EDIT:
already have tried:
let viewController = MasterViewController() viewController.settingsButton.sendActionsForControlEvents(.TouchUpInside)
which gives me an error:fatal error trying to unwrap an optional value!
although this exists in MasterViewController
@IBOutlet weak var settingsButton: UIButton!