Show segue inexplicably changes to a modal segue when a container view controller is used

I don't know the exact cause of this but I am guessing it has something to do with a container view controller being used. I am actually using several containers, one is for a SWRevealViewController, which houses a generic UIViewController for its rearViewController and a UINavigationController for the frontViewController. The root view controller of this navigation controller is another container view controller, a MainViewController, which contains a UIPageViewController. Page view controller has 3 UITableViewControllers and when I try to navigate from those table view controllers to the relevant view controllers (via a segue), and I want it to be a push transition, it makes a modal transition so what gives?

It is something to do with hierarchy I guess, but it is kinda messed up with all these view controllers right now and I think I broke my brain at some point. I would really appreciate if someone who knows what is wrong can explain.

-------------Problems Reply------------

was stuck with the same problem and tried to solve for almost 2 days, and finally solved that..

View Hierarchy:

Container View

  • First Controller (direct child of container)
  • Second Controller (direct child of container)
    • Third Controller
    • Fourth Controller

Solution

  • added Navigation controller to First Controller
  • added Navigation Controller to Second Controller

and when want to display any controller instead of presenting the controller itself present the UINavigationController, this will solve the problem of not happening segue push animation...

sample code, hoping it will help:

import UIKit

class ViewController: UIViewController {

var loginViewNavigation : UINavigationController!
var singupViewNavigation : UINavigationController!

override func viewDidLoad() {
super.viewDidLoad()

var storyBoard = UIStoryboard(name: "User", bundle: nil)

loginViewNavigation = storyBoard.instantiateViewControllerWithIdentifier("LoginViewNavigation") as! UINavigationController
singupViewNavigation = storyBoard.instantiateViewControllerWithIdentifier("SignupViewNavigation") as! UINavigationController

self.addChildViewController(loginViewNavigation)
self.addChildViewController(singupViewNavigation)

self.view.addSubview(loginViewNavigation.view)
}
}

Point to observe is the use the UINavigationController of the controller you want to display instead of that ViewController

Thanks for the replies but I got it working without the use of segues and the storyboard, by pushing the view controller in tableView delegate manually, like this:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

PlaceViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"placeViewController"];
vc.place = self.places[indexPath.row];

[self.navigationController pushViewController:vc animated:YES];

}

Category:ios Views:72 Time:2019-03-23

Related post

  • Change Navigation Bar Tint Color while presenting new view controller modally in iOS 4.x 2012-04-26

    In my view controller's I have following code - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSLog(@"%s",__PRETTY_FUNCTION__); self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:201.0/255.0 green:201.0

  • Problem with modal dialog when rotating a view 2011-01-11

    I have a child view (not root, let it be view A) that can be rotated. Also I have a modal view (let it be view M) that is shown then a data comes in from the server. Our QA's found that if the data comes when the that view A is rotating, the modal vi

  • Outlook 2007 showing 2 e-mail addresses instead of 1 when sending e-mail to recipients using Outlook 2007. 2012-09-29

    I have a client of mine using outlook 2007 and has 2 seperate incoming and outgoing e-mail servers. incoming e mail server is the company's pop server and the outgoing e-mail server is the bell sympatico smtp server. the user name and passwords are a

  • How can I change size when showing a modal view controller using storyboard? 2012-04-15

    Using storyboard, I create a transition to another view controller using modal style and form sheet presentation. But always has the same size. How can I change this view controller size using storyboard? I found some code that almost work, but I nev

  • Multiple segues from table view controller 2012-04-17

    I have a small app that uses multiple section layouts for the initial table view. One section displays the most recent trends from Twitter and the other section displays the most recent stories from Twitter. When I click on an item within the list of

  • How do I create storyboard segue from a view controller to itself? 2011-11-16

    Is it possible to create a storyboard segue from a view controller to itself? I have a bunch of Entities that have Related Entities. I'd like to be able to display a Related Entity using the same view controller that's displaying the Entity. But I ca

  • Push Segue Not Loading Destination View Controller Visibly 2015-01-03

    I have a view controller embedded in a navigation controller where I want to perform a push segue to reach another view controller. When I call [self performSegueWithIdentifier:@"segueStudy" sender:self]; I know the push segue does get called as prep

  • Presenting a Modal View Controller hides the Navigation Bar 2011-08-11

    I have a navigation based app with a navigation bar, but there are a few instances where instead of pushing a view controller onto the stack, I need to present the view controller modally. The problem is that when I dismiss the modal view controller,

  • Dismissing a modal view controller using a different animation than it was presented with 2011-10-17

    I have an application that presents a view controller (for registering / logging in) with a container view, and two views as switched between eachother using horizontal flipping. The app itself can be used before registration. I'm looking to change t

  • trying to update a UILabel on a parent view controller when dismissing the modal view 2012-01-18

    I am trying to update a UILabel in a parent View after someone makes a change in a modal view. So, after they click "save" ... the newly entered value would change what text is displayed on the parent view controller. But, I can't seem to get that UI

  • How can I bring up a modal view controller under another one? 2011-11-23

    I have a navigation problem. I want to create the following navigation structure: Start on screen A. When a button is pressed, screen B animates up as a modal view controller, covering A. In the first scenario, when screen B is dismissed it slides do

  • IOS Modal View Controller Presents Black Screen 2012-01-10

    I am working on an IOS app and have been stumped by this problem for about a week now and cannot find a solution. Any help you can offer would be greatly appreciated. Here's my set-up: I have a tab bar controller. I have a TableViewController which h

  • Table View View Controller Show Next View 2013-08-18

    Im working with table view controllers within story board. I currently have one tableview controller embedded in navigation controller in my storyboard. This table view controller is linked to an ObjectiveC file. Through code i can display another ta

  • Modal View Controller Won't Start in Landscape Mode 2010-09-22

    I have a navigation based app that has a detail view (UIWebView) with action buttons across the bottom in a UIToolbar. I want to add 'notes' when the 'notes' button is pushed. Everything works fine when the webview is in portrait mode. I press the no

  • Modal view controller won't dismiss itself 2011-07-02

    What I'm doing: In my app, I'm presenting a modal view controller (containing app settings) using the following code: optionsViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl; [self presentModalViewController:optionsViewControll

  • Modal View Controller don't rotate correctly 2012-01-17

    On the ipad, in ios objective C, I am having problems with the rotation moves in one modal view. I give the position of the element in the shouldAutoRotate method and its parent view can rotate too, but when I rotate the modal view the elements don't

  • Presenting/dismissing modal view controller with custom animations does not display presenting view controller underneath 2012-04-10

    I have implemented a view controller which provides a navigation structure similar to UINavigationController. It is using view controller containment. All view controllers are added as children. When I present a modal view controller from a view cont

  • Returning from dismiss modal view controller - any way to detect? 2010-11-02

    Wonder if anyone can help me. I have a setup whereby a main menu presents the main game as a modal view controller. At this point it also stops playing the main menu music. The problem is that when the game view controller dismisses itself (e.g when

  • UIWebView - crash when dismissing modal view controller while request is in progress 2011-04-21

    Hey all, I am presenting a modal view controller and loading a webpage on that view controller in a UIWebView: - (void)viewWillAppear:(BOOL)animated { self.requestObj = [NSURLRequest requestWithURL:[NSURL URLWithString:[MPServerPrefs serverPrefs].url

  • How to dismiss modal view controller using UIAlertView? 2011-12-02

    I'd like to dismiss the whole modal view controller by tapping cancel on the UIAlertView that I implemented. The alert view asks the user if he wants to logout and if the user taps Yes, it'll dismiss the modal view controller. How can I do this in Xc

  • modal view controller not calling presenting view controller's dismissModalViewControllerAnimated: method 2012-01-18

    In my modal view controller I have a button handling method that includes [self dismissModalViewControllerAnimated: YES]; In the presenting view controller I override dismissModalViewControllerAnimated: as follows: -(void) dismissModalViewControllerA

  • present new modal view controller then dismiss old modal view controller 2012-03-01

    i want to dismiss my current view controller then load up a new view controller. this seems like it should work: FieldReportViewController *fieldReport = [self.storyboard instantiateViewControllerWithIdentifier:@"fieldReportView"]; [self presentModal

  • How to create custom modal segue in 4.2 Xcode using storyboard 2011-11-11

    I'm using storyboard to create my new iPad project. I want use the custom modal segue to have better transitions between views. My question is how do I use the custom modal and is there any tutorials out there that show using custom modal segues? ---

  • Form Sheet of Modal Segue doesn't work with storyBoard 2014-11-24

    i am trying to present a view modally using the Model "Form Sheet". Surprisingly, all subviews that i add via storyboard are not shown , but when i try to create them using code (on viewDidload for example) these views are shown in the screen. Also w

  • Modal segues in xcode 2014-12-23

    When I run the application on Xcode an error appears saying "Modal segues are deprecated in iOS 8.0 and later". When I get to the simulator everything appears very large even after I reduce the scale to 50%. --------------Solutions------------- There

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.228 (s). 11 q(s)