'Show' segue in Xcode 6 presents the viewcontroller as a modal in iOS 7

后端 未结 11 431
离开以前
离开以前 2021-01-01 10:11

I have two view controllers in my iPhone application (built with swift) built with Xcode 6.1 and uses storyboards.

The first view controller is embedded in a navigat

11条回答
  •  说谎
    说谎 (楼主)
    2021-01-01 10:50

    This solution is different from the others in the following ways:

    1. It includes a method to examine and verify the issue
    2. The cause of the issue is traced to the source (a change in the segue type)
    3. The solution is very simple (delete and recreate a new segue)
    4. Please note the requirements in the text

    I just gave a very detailed SO answer that fully explains what is happening and why, but the simple solution is you can delete the Segue that is not pushing and then recreate it on the storyboard. The reason is that there is likely a broken bit of xml in the segue (see extended answer for example/instructions how to confirm this issue).

    After you confirm that you have at least one UINavigationController within the view hierarchy, be sure that the segue is NOT a manual segue and does NOT have an action associated with it (by viewing the segue in the storyboard as Source Code). Delete the existing segue and then Ctrl-drag from a UIView/UIControl to the target view controller and if custom action is needed intercept the call to destination controller in prepareForSegue.

    Also to confirm that this solution works for you please do the following:

    • Verify that your initial view controller (with the arrow on it) is a UINavigationController and that it has a normal content view controller as it's root view controller. (or that you embed your initial view controller inside of a UINavigationController)
    • Read my extended comments on an earlier response to a very similar question (linked above).

提交回复
热议问题