Passing data with segue through navigationController

The destination view controller of the segue is the UINavigationController. You need to ask it for its top view controller to get to the real destination view controller: override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == “showItemSegue” { let navController = segue.destination as! UINavigationController let detailController = navController.topViewController as! ShowItemViewController detailController.currentId = … Read more

iOS Segue – Left to Right –

This is how I achieve the effect without requiring a nav-controller. Try this instead: Swift 4: import UIKit class SegueFromLeft: UIStoryboardSegue { override func perform() { let src = self.source let dst = self.destination src.view.superview?.insertSubview(dst.view, aboveSubview: src.view) dst.view.transform = CGAffineTransform(translationX: -src.view.frame.size.width, y: 0) UIView.animate(withDuration: 0.25, delay: 0.0, options: .curveEaseInOut, animations: { dst.view.transform = CGAffineTransform(translationX: 0, … Read more

How to segue back to a UIViewController that’s already loaded?

Assuming by your use of “push” you mean that you are using a UINavigationController, then you can use the following to return to the top of the stack. [self.navigationController popToRootViewControllerAnimated:YES]; or UIViewController *prevVC = [self.navigationController.viewControllers objectAtIndex:<n>]; [self.navigationController popToViewController:prevVC animated:YES]; to pop to a specific level where <n> is the level. or [self.navigationController popViewControllerAnimated:YES]; If you … Read more

How to make a push segue when a UITableViewCell is selected

control drag From View Controller to View Controller You will need to give an identifier to your segue: Perform the segue: -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self performSegueWithIdentifier:@”yourSegue” sender:self]; } Now here is the thing, this will just perform the segue, if you ever needed to pass some data to that view controller. Then you … Read more

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