如何检查我的Swift应用程序是否使用QuickAction打开?我在寻找一个可以在viewDidLoad内部的解决方案。
例如:
override func viewDidLoad() {
if *VC was opened with a QuickAction* == true {
// do this
else {
// do sth else
}
}谢谢你的帮忙!
发布于 2016-08-01 20:41:16
通过3D触摸打开应用程序时,将调用AppDelegate中的以下方法
func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void) {
//Navigate to required viewController from here
//YourViewController.isOpenedThrough3DTouch = true
}您可以为所有的ViewControllers创建一个基类,并声明一个布尔变量isOpenedThrough3DTouch
在开始导航到所需ViewController的AppDelegate回调中,将此变量设置为true,以便您的viewDidLoad知道
https://stackoverflow.com/questions/38698114
复制相似问题