Tag: quickaction

如何使用由Swift编写的Xcode中的TabBarControllerpipe理的ViewControllers处理iOS应用程序的静态QuickAction

我已经在Info.plist中创build了一些(静态的)QuickActions,用于在Xcode中创build并用Swift编写的iOS应用程序。 我有问题,使他们能够打开一个ViewController。 原因,我已经GOOGLE了,但没有为我工作。 如果这是重要的:我使用由TabBarControllerpipe理的ViewController。 大多数教程似乎使用NavigationController。 但是,我认为这将与赛段完成,对吧? 我需要什么代码来处理它? 有人可以提供吗? 还是有人知道一个简单的手册/教程? 问候,大卫。 PS:我试过这个代码,但它似乎只适用于NavigationController? 码: func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void) { self.handleShortcutItem(shortcutItem) completionHandler(true) } func handleShortcutItem(shortcutItem: UIApplicationShortcutItem) { switch shortcutItem.type { case "icons.quickaction.home": self.presentComposeViewController() default: break } } func presentComposeViewController() { guard let navigationController = window?.rootViewController as? UINavigationController else { return } let […]