uistoryboardsegue

Push to root View controller in UIStoryboard

坚强是说给别人听的谎言 提交于 2019-12-04 22:33:18
I have hierarchy of ViewControllers in my storyboard structure. It is A-B-C-D . A is embed with NavigationController and the flow goes on till D viewController . All fours view attached through segues. Now I am on D viewController , I defined some action to the button of D that It should take me directly to A viewController that is rootViewController or B viewController . Then how can I achieve this. I tried everything but didn't succeed. I want something like it should not disturb A-B-C-D flow and it should take me to A viewController from D . Right click on your D viewcontroller and drag i

viewWillAppear called twice with custom segue animation using transitionFromView

为君一笑 提交于 2019-12-04 21:36:51
问题 I'm looking to perform a segue to replace the window's root view controller by another view controller using a curl up animation. The idea is that I have a SplashViewController being displayed for a couple of seconds before transitioning ( performSegueWithIdentifier: ) to the next one, LoginViewController , using the curl up animation. I've created a custom UIStoryboardSegue class called AnimatedSegue . Here is the code of the overridden perform method: - (void)perform { UIViewController

UITableView “selection” triggered segue

只谈情不闲聊 提交于 2019-12-04 19:25:16
问题 I am using Storyboard and UITableView without UINavigationController . When tapping on any cell, it should bring user to a detail page. I can of course implement didSelectRowAtIndexPath: But I wished to try something fairly different. I want to do it with a storyboard segue . I use prototype cell, and I can simply config a triggered segue on the cell. I can implement prepareForSegue: , but here's the problem, how can I know what cell has been selected? 回答1: The prepareForSegue:sender: method

iOS7 issue with modal view controller segue from custom cell selection

不问归期 提交于 2019-12-04 15:10:41
问题 Final Edit After further investigation I thought it would be best to repost the question with more information on the sepcific issue. This issue seems to occur only on iOS7. I have tested on iOS6 and this works without issue. -- Setup The setup is you have one UIViewController (first VC for example), this holds a tableView and is the datasource/delegate. When the cell in tableView is selected/tapped you perform a segue to the Second View Controller (this can be empty for now). Issue The issue

Displacing one view with another with a custom segue animation?

半城伤御伤魂 提交于 2019-12-04 14:39:19
问题 I am trying to implement SUBJ but can't make destination segue appear in my animation. I want to make animation for view change where new segue will displace old one. Currently my perform method looks like this: - (void) perform { UIViewController *src = (UIViewController *) self.sourceViewController; UIViewController *dst = (UIViewController *) self.destinationViewController; [UIView animateWithDuration:2.0 animations:^{ //tried a lot of staff to make dst view to fall from top at the same

prepareForSegue and popViewController compatibility

空扰寡人 提交于 2019-12-04 14:18:24
问题 The question I'm working on a iOS app and i have 3 consecutive ViewControllers : TableViewController --> DetailViewController --> ImageViewController I perform de forward Segue with a button (Just control drag on Storyboard ) and to go back I have a custom back button with [self.navigationController popViewControllerAnimated:YES]; To send data forward I use - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { [segue.destinationViewController someFunction]; } To send data to

a Custom Segue that Simulates a Push Segue turns VC into Zombie

回眸只為那壹抹淺笑 提交于 2019-12-04 13:30:07
问题 [To Make things short and clear] I've written a custom segue. -(void)perform { UIView *preV = ((UIViewController *)self.sourceViewController).view; UIView *newV = ((UIViewController *)self.destinationViewController).view; [preV.window insertSubview:newV aboveSubview:preV]; newV.center = CGPointMake(preV.center.x + preV.frame.size.width, newV.center.y); [UIView animateWithDuration:0.4 animations:^{ newV.center = CGPointMake(preV.center.x, newV.center.y); preV.center = CGPointMake(0- preV

Separate Button action and segue action

天涯浪子 提交于 2019-12-04 12:53:18
问题 I have to push a new segue when a button is pressed. But i also have an action attached to it that needs to be triggered before the segue is pushed. Can you tell me how to separate them from each other? Any help would be appreciated. 回答1: Make the segue directly from one view controller to the other instead of connecting it to the button. Give it a meaningful name. Then, in your button's action method, perform whatever you need to do first, then perform the segue using your view controller's

Dismiss Popover using Unwind Segue in Xcode Storyboard

一笑奈何 提交于 2019-12-04 09:38:44
I am using Xcode 4.5 and the new iOS 6 feature to unwind segues. I am presenting a navigation view controller inside a popover which is presented programmatically from a bar button item: - (IBAction)configChartTapped:(id)sender { if (self.popover.isPopoverVisible) { [self.popover dismissPopoverAnimated:YES]; } else { UINavigationController *chartConfigNavigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"GrowthChartNavigationController"]; ConfigChartTypeViewController *configChartTypeViewController = (ConfigChartTypeViewController*) chartConfigNavigationController

unwind with custom segue on UINavigationController pop via “back” button

自作多情 提交于 2019-12-04 08:57:47
问题 Simple storyboard setup: UIViewController with UINavigationController. On a table cell click a custom segue pushes a new UIViewController onto the navigation stack. All good. But then pressing the "back" button in the navigation bar, it only uses the default pop animation. How do I tell the navigation controller to use my custom segue when popping back? I've added - (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController