1

ショートカット アイテムを使用して特定のビュー コントローラを起動して移動する方法は?

アプリで UINavigationController を使用しています。問題は、ショートカット項目をクリックすると、最後のView Controllerに直接移動する必要があることです。最後のView Controllerには、前の画面に戻るための戻るボタンがあります。これは可能ですか?

 func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: Bool -> Void) {
        let handledShortCutItem = handleShortCutItem(shortcutItem)

    completionHandler(handledShortCutItem)
}


func handleShortCutItem(shortcutItem: UIApplicationShortcutItem) -> Bool {
    var handled = false

    // Verify that the provided `shortcutItem`'s `type` is one handled by the application.
    guard ShortcutIdentifier(fullType: shortcutItem.type) != nil else { return false }

    guard let shortCutType = shortcutItem.type as String? else { return false }

    switch (shortCutType) {
    case ShortcutIdentifier.LastViewController.type:
        print("Inside Agent **********")
        **// Navigate to view controller**
        handled = true


        break

    default:
        break
    }
4

0 に答える 0