ActionSegueの動作を確認してみました。
UINavigationControllerにセットされているController
まずは、下のようにUINavigationControllerにセットされているControllerからのSegueの挙動を確認してみました。
Show
UINavigationControllerのpushメソッドを呼んだ時と同じ挙動になりました。
Show Detail
UINavigationControllerのpushメソッドを呼んだ時と同じ挙動になりました。
Present Modally
UIViewControllerのpresentメソッドを呼んだ時と同じ挙動になりました。
Present As Popover
UIViewControllerのpresentメソッドを呼んだ時と同じ挙動になりました。
UINavigationControllerにセットされていないController
今度はUINavigationControllerにセットされてないControllerの挙動を確認してみました。
Show, Show Detail, Present Modally, Present As Popover
全て、UIViewControllerのpresentメソッドを呼んだ時と同じ挙動になりました。
コード上でUINavigationControllerにセットされたController
コード上でUINavigationControllerにセットされたControllerの挙動も確認しました。
import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) window?.makeKeyAndVisible() if let c = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() { window?.rootViewController = UINavigationController(rootViewController: c) } return true } }
Show, Show Detail
UINavigationControllerのpushメソッドを呼んだ時と同じ挙動になりました。
Present Modally, Present As Popover
UIViewControllerのpresentメソッドを呼んだ時と同じ挙動になりました。
Storyboard上でUINavigationControllerにセットした場合と同じ動きをしました。