uistoryboardsegue
NSInvalidArgumentException – receiver has no segue with identifier
I was able to fix it by running “clean” under the “Product” menu in Xcode, and resetting the contents and settings in the simulator.
How to check if a view controller can perform a segue
To check whether the segue existed or not, I simply surrounded the call with a try-and-catch block. Please see the code example below: @try { [self performSegueWithIdentifier:[dictionary valueForKey:@”segue”] sender:self]; } @catch (NSException *exception) { NSLog(@”Segue not found: %@”, exception); } Hope this helps.
To stop segue and show alert
If your deployment target is iOS 6.0 or later You can simply implement the shouldPerformSegueWithIdentifier:sender: method on your source view controller. Make this method return YES if you want to perform the segue, or NO if you don’t. If your deployment target is earlier than iOS 6.0 You will need to change the way your … Read more
Storyboard Segue Identifier naming conventions
As with most things in programming, you can use any name you like. But, as with most things in programming, names matter and good names are hard. Here’s how I name segues… Good segue names Name segues as you would name action methods. Name segues by what they will do. Good segue name examples: addUser … Read more
How do I do a Fade/No transition between view controllers
If presenting a modal view controller, you can specify a modalTransitionStyle of UIModalTransitionStyleCrossDissolve. If doing this with a segue in your storyboard, select the attributes inspector for the segue, and specify the transition style there: If presenting the view controller programmatically, you can define your modal segue between the view controllers in your storyboard with … Read more
Prepare for Segue in Swift
This seems to be due to a problem in the UITableViewController subclass template. It comes with a version of the prepareForSegue method that would require you to unwrap the segue. Replace your current prepareForSegue function with: override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) { if (segue.identifier == “Load View”) { // pass data to next view … Read more
Instead of push segue how to replace view controller (or remove from navigation stack)?
To expand on the various segues above, this is my solution. It has the following advantages: Can work anywhere in the view stack, not just the top view (not sure if this is realistically ever needed or even technically possible to trigger, but hey it’s in there). It doesn’t cause a pop OR transition to … Read more
Warning: Attempt to present * on * which is already presenting (null)
I have found out a solution. I have add the following code in HomeViewController.viewDidLoad and that works ! definesPresentationContext = true