IOS7, Segue and storyboards – How to create without a button?

Delete the current segue. Attach the segue from the origin view controller to the destination (and then name it). Now, your button press method should look something like this: Objective-C: – (IBAction)validateLogin:(id)sender { // validate login if (validLogin) { [self performSegueWithIdentifier:@”mySegue” sender:sender]; } } Swift: @IBAction func validateLogin(sender: UIButton) { // validate login if validLogin … Read more

Swift pass data through navigation controller

Override prepareForSegue and set whatever value on the tableview you’d like. You can grab the tableview from the UINavigation viewControllers property. override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!){ let navVC = segue.destinationViewController as UINavigationController let tableVC = navVC.viewControllers.first as YourTableViewControllerClass tableVC.yourTableViewArray = localArrayValue } For Swift 3 : override func prepare(for segue: UIStoryboardSegue, sender: Any?) { … 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

Storyboard Segue From View Controller to Itself

If you are using a navigation controller you need to push the ViewController into the nav stack. In this example, i named my ViewController “VDI” in my Storyboard ID setting. UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@”MainStoryboard” bundle: nil]; YourVC *dest = [storyboard instantiateViewControllerWithIdentifier:@”VDI”]; [self.navigationController pushViewController:dest animated:YES]; If you don’t want the NavigationController to keep adding itself … Read more

What are the differences between segues: “show”, “show detail”, “present modally”, “present as popover”? [closed]

1. Show – Pushes the destination view controller onto the navigation stack, moving the source view controller out of the way (destination slides overtop from right to left), providing a back button to navigate back to the source – on all devices. Example: Navigating inboxes/folders in Mail. 2. Show Detail – Replaces the detail/secondary view … Read more

How to present view controller from right to left in iOS using Swift

It doesn’t matter if it is xib or storyboard that you are using. Normally, the right to left transition is used when you push a view controller into presentor’s UINavigiationController. UPDATE Added timing function kCAMediaTimingFunctionEaseInEaseOut Sample project with Swift 4 implementation added to GitHub Swift 3 & 4.2 let transition = CATransition() transition.duration = 0.5 … Read more

Conditionally start at different places in storyboard from AppDelegate

I’m surprised at some of the solutions being suggested here. There’s really no need for dummy navigation controllers in your storyboard, hiding views & firing segues on viewDidAppear: or any other hacks. If you don’t have the storyboard configured in your plist file, you must create both the window and the root view controller yourself … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)