ios,objective-c,uitableview,uistoryboardsegue
In prepareForSegue, the sender argument will be the cell, so you can work out which one was tapped at that point. You could also check the tableview's selectedIndexPath property. You don't need to implement both functions. ...
ios,ios8,uistoryboardsegue,uiviewanimationtransition
Some differences: Segues can only be used with storyboards. Animator objects can be used programmatically, or along with segues. Animator objects allow you to set a customized final position and size for your new view controller. Animator objects can be configured to do special animations with navigation controllers and collection...
ios,objective-c,storyboard,segue,uistoryboardsegue
you call performSegueWithIdentifier:sender: in the viewDidLoad. You can not dismiss a UIViewController that isn't presented yet. viewDidLoad has purely memory management functions, you can use it as (part of a) constructor. What may work, is to start a segue in viewDidAppear, however I would suggest to start with the view...
ios,swift,segue,uistoryboardsegue
You can initiate nextview programetically this way: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewControllerWithIdentifier("someViewController") as! UIViewController self.presentViewController(vc, animated: true, completion: nil) ...
You can't do this with a segue, since segues always instantiate new controllers. Instead of a segue, you should create a property for ViewControllerB in ViewControllerA, and instantiate it only the first time you go to it (which you would do using presentViewController:animated:completion). After coming back to A, when you...
ios,objective-c,uistoryboardsegue
chatrooms defined as an ivar like you have done is accessed using -> notation: groupView->chatrooms = [NSMutableArray arrayWithArray:chatrooms] This is generally discouraged, though. You should use a property instead: @interface GroupView @property (strong) NSMutableArray *chatrooms; @end Incidentally, if you're using an NSMutableArray, that indicates that you want to modify the...
uitableview,swift,segue,uistoryboardsegue
That's not a new question, many topics about. You should specify a tag on each cell : cell.tag = 0 In your prepareForSegue, use : if sender!.tag.littleEndian == 0 { let UIViewController:ViewController = segue.destinationViewController as YourSpecificViewcontroller } else if sender!.tag.littleEndian == 1 { let UIViewController:ViewController = segue.destinationViewController as YourOtherSpecificViewcontroller }...
ios,xcode,uinavigationcontroller,uistoryboardsegue
let controller: CropViewController = segue.destinationViewController as CropViewController Double check if segue.destinationViewController is actually the navigation view controller. If it's the navigation controller, get CropViewController from it: if segue.identifier == "camera2Crop" { let navController = segue.destinationViewController as UINavigationController let controller = navController.viewControllers[0] as CropViewController controller.photoTaken = self.photoTaken } Note you don't...
storyboard,segue,watchkit,uistoryboardsegue,apple-watch
Page-based navigation and hierarchical navigation are exclusive – you can't mix and match unless you present a new interface modally. This is expected behaviour.
ios,objective-c,uinavigationcontroller,uistoryboardsegue
Try implementing the shouldPerformSegueWithIdentifier:sender: or prepareForSegue:sender: methods in the 'from' view controller. Put a break point or NSLog() inside the method to inspect the segue identifier. This will prove that you indeed set up the segue correctly in the storyboard. If you want to manually push your next view controller...
ios,objective-c,xcode,uiviewcontroller,uistoryboardsegue
First of all set Storyboard ID to your SecondView Controller like below image. Then add following code at your button click event. - (IBAction)moveToViewcontrollerB:(id)sender { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard2" bundle: nil]; SecondStoryboardVC * secondStoryboardVCOBJ_ = [storyboard instantiateViewControllerWithIdentifier:@"SecondClassStoryboardID"]; [secondStoryboardVCOBJ_ setStrValue:@"The transfer of data worked!"]; secondStoryboardVCOBJ_.modalTransitionStyle = UIModalTransitionStyleCoverVertical;...
objective-c,profiler,uistoryboardsegue
The problem, clearly displayed in your log, is that One, Two, Three, and Four are being performed on a background thread. This means, for example, that you are saying: [self performSegueWithIdentifier:@"login_success_new" sender:self]; ...on a background thread. That is so wrong. You must NEVER say anything to or about the interface...
ios,objective-c,xcode,uistoryboard,uistoryboardsegue
You would remove the sender part of your code. It should look like this: - (void)prepareForSegue:(UIStoryboardSegue *)segue{ //your code //check if the next view exists by checking for the id if ([[segue identifier] isEqualToString:@"Segue_Name"]) { DovizTableViewController *controller = [segue destinationViewController]; controller.user = self.user; } } ...
swift,segue,uistoryboard,uistoryboardsegue,alamofire
I think that not using IBAction is a good solution in this case but anyway there is a workaround how to achieve your goal. For this workaround you need to declare a variable typed boolean to check wether user is ready to login. Your shouldPerformSegueWithIdentifier method should always return value...
ios,swift,cocoa-touch,push-notification,uistoryboardsegue
The answer code is Objective-C, I want to talk about logic. To do this, when you are creating your push notification, you must set userInfo value to pass data with your push notification. Use this delegate method : application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler You can decide if which view...
ios,objective-c,uistoryboard,uistoryboardsegue
Instead of connecting and creating segue from individual cells, you can connect all those segues from the View Controller button, lying below your view in your storyboard. In this case, you will have multiple segues and none of them will be individually connected to cells. And when segues are ready,...
swift,segue,uistoryboard,uistoryboardsegue
Try to create the Segue to a Navigation controller instead of your view controller. Navigation bars are only shown for view controllers in a navigation stack. In your case, the source view controller seems to be in a navigation stack but not the presented view controller. Try something like this:...
To create a segue, you need to control+click from the trigger of the segue (button, link, etc.) to the new view controller. A view controller cannot trigger a segue. In keeping with the tutorial, try control+drag from the menu button to the target VC. That will solve your problem, but...
ios,uinavigationcontroller,orientation,uistoryboardsegue
Try this code : In AppDelegate.m class write below code. #pragma mark Orientation Code - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { NSUInteger orientations = UIInterfaceOrientationMaskAll; if (self.window.rootViewController) { UIViewController* presented = [[(UINavigationController *)self.window.rootViewController viewControllers] lastObject]; orientations = [presented supportedInterfaceOrientations]; } return orientations; } And next if you don't want orientation of...
ios,swift,ios8,uistoryboard,uistoryboardsegue
If you're not using a navigation controller or a split view controller, then a "Show Detail" segue is the same as a modal presentation. A controller that presents another keeps a reference to it in its presentedViewController property (and the presented controller has a reference to the presenter in its...
You need a custom transition using UIKit Dynamics to perform the animation.
ios,objective-c,xcode,delegates,uistoryboardsegue
Using an unwind segue is very similar to having a delegate, with the following advantages: You don't need to implement any dismiss logic You don't need to pass references up and down the navigation stack You don't need to declare a delegate protocol It's trivial to unwind back a number...
ios,interface-builder,uistoryboardsegue
A method with with a particular signature, an IBAction with an argument of type UIStoryboardSegue, needs to be in the controller that you are unwinding to. That (and any other methods like it that you might have in other controllers) will show up in the exit button (of the controller...
ios,xcode,uiviewcontroller,uistoryboard,uistoryboardsegue
you can set the LoginViewcontroller as initial viewcontroller and if the user is logged in change the initial viewcontroller to something else, you can change the initial view controller by changing the rootViewController property of the window
xcode,swift,segue,uistoryboardsegue
I have a table view segueing to a navigation controller, which then segues to my own custom view controller under it. I believe that is your problem. The connection from the Navigation Controller to your Detail View Controller isn't a normal segue. It should be a Relationship Segue. Click...
ios,objective-c,viewcontroller,uistoryboardsegue
You can do that using code - Create IBAction method for Search Button UIControlEventTouchUpInside event. Now check user SignIn or SignOut within IBAction method and push respective viewController using below code SignINViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"SignINViewController"]; [self.navigationController pushViewController:controller animated:YES]; Don't forgot to provide Storyboard ID & Restoration ID for your...
ios,objective-c,uiviewcontroller,uialertview,uistoryboardsegue
It looks like your UIAlertView has a delegate of nil so your function is never being called. Set that to self and then in your view controller's header make sure you're implementing the UIAlertViewDelegate protocol.
1. Control-drag from yellow symbol (ViewController) to the TabBarController This will create a segue in your ViewController menu 2. Click this new segue "Show segue to Tab..." and in identity inspector set an identifier name. 3. Now when you want to make the segue happen, use call... performSegueWithIdentifier("WhatEveryYouNamedSegue", self) ...
ios,swift,storyboard,segue,uistoryboardsegue
I found a solution. The App checks on the server if the user is already logged in or not (function: isLoggedIn). If he is not logged in the performSegueWithIdentifier function is called to show the login View. The problem was that the my code calls performSegueWithIdentifier in a closure (success...
Unwind segues are different to forward segues and this makes it quite simple to support the functionality you are after. Prior to creating an unwind segue you need to add a method to the view controller that you want to unwind to. For example - - (IBAction)unwindFromLogin:(UIStoryboardSegue*)sender { } You...
objective-c,ios8,uistoryboardsegue
According the documentation dismissViewControllerAnimated Dismisses the view controller that was presented modally by the receiver. So this works for modally presented controllers, for navigation stacks, use unwind segues instead....
ios,objective-c,uiviewcontroller,singleton,uistoryboardsegue
Singleton is NOT the perfect way, as it messes up your memory management easily. Same with NSUserDefaults (+ it only eats certain classes and persists data that probably shouldn't be persisted). Just pass the object from view controller to view controller. if you find 7 view controllers to difficult to...
Make sure you are 100% certain of segue.identifier: Modify print("Identifier: FBLoggedInSegue") to display the actual identifier, otherwise you are working off assumptions. Have you set the ID on the view you wish to segue to or or the actual segue line in the Interface Builder? Hope this helps :) EDIT:...
ios,xcode,uistoryboard,uistoryboardsegue
Show segue can be used with navigation controllers, they simply push viewControllers on your stack. Show detail segue has only sense with split view controllers. Since you have two viewControllers inside your split view controller you can: navigate in your master view controller by presenting (pushing, since the default project...
ios,uistoryboard,uistoryboardsegue,state-restoration
Because the view controllers are restored in order, starting with the root, I found it's actually pretty simple to do what I asked. First, get the index of the current view controller in the Navigation controller. From that, figure out which view controller came before. (If my Storyboard was more...
There are a couple of ways to do this. First of all, UIButtons can actually have a background image, which you could set to your various images. If you're intent on using a UIImageView, you would have to implement its touch event receiving method and handle it yourself. Either way,...
ios,uitableview,uistoryboardsegue,didselectrowatindexpath,swrevealviewcontroller
//in prepareForSegue method NSIndexPath *indexPath = [tableView indexPathForSelectedRow]; and you can get selected row value by using indexPath.row ...
ios,touch,transition,uistoryboardsegue
UIApplication offers you beginIgnoringInteractionEvents and endIgnoringInteractionEvents so you can disable all touch event handling during certain times (like a view transition). Be sure to call endIgnoringInteractionEvents once for each time you call beginIgnoringInteractionEvents....
swift,ios8,segue,uistoryboardsegue
You can close it pretty easy by using dismissViewControllerAnimated on the UIViewController you want to dismiss: navegador.dismissViewControllerAnimated(true, completion: nil) Maybe you need to make the NavegadorViewController a global variable, so that you can access it from another method....
ios,objective-c,storyboard,uistoryboardsegue
check this , i think what you want is similar to this. -(IBAction)buttonAction:(id)sender{ int randomNumber= arc4random() % 3; switch (randomNumber) { case 0: [self performSegueWithIdentifier:@"segue1" sender:sender]; break; case 1: [self performSegueWithIdentifier:@"segue2" sender:sender]; break; case 2: [self performSegueWithIdentifier:@"segue3" sender:sender]; break; default: break; } } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier...
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSIndexPath *indexPath = [self.myTableView indexPathForSelectedRow]; ThirdViewController *destViewController = (ThirdViewController *)segue.destinationViewController; destViewController.displayTitlesArray = [[NSArray alloc]initWithObjects:@"first ",@"second",@"Third", nil ];} ...
ios,cocoa-touch,uistoryboard,uistoryboardsegue
Well, I figured out the issue. Ends up that the super method is alright, the problem lies on a UINavigationController subclass that I made that forwards the call to this view controller. To fix it, I added a protocol that any view controller can implement, and basically asks if it...
ios,uitableview,xamarin,uistoryboardsegue
Ok. I'm a little embarrassed at my error here. I hadn't created an outlet for my UITableView and was instead using a tableview that I had created and added through code in my ViewController. Therefore the "Scene Exit" that I hooked up to the UITableViewCell on my storyboard was never...
ios,uitableview,uiview,autolayout,uistoryboardsegue
You just have to create a a CGRect (frame) and set it to the views frame: dst.view.frame = CGRectMake( CGRectGetMinX(self.view.frame), CGRectGetMinY(self.view.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame); the values should be float values. This is just an example....
ios,swift,uiviewcontroller,parse.com,uistoryboardsegue
The way I usually accomplish this, and this applies to apps both with and without tab bars, is to have some kind of requires authentication flag in the destination view controller, and if the user isn't logged in, present the login screen modally. e.g. inside the friends list view controller...
ios,objective-c,segue,uistoryboardsegue
You can work on the viewWillDisappear method on your second view controller like this: - (void)viewWillDisappear:(BOOL)animated { if(self.isMovingFromParentViewController){ NSLog(@"Controller being popped"); } } In this case, self.isMovingFromParentViewController will be true if the controller is being popped. You can also check for self.isMovingToParentViewController on viewWillAppear for example, to check that the...
ios,swift,segue,uistoryboardsegue,unwind-segue
Created Sample code for unwind segue with above transition animation code. Checkout SampleUnwind project that will help you to understand unwind segue(and how simple it is). In project there is one navigation controller and inside it there are three view controller (Home->First->second). In Home controller following unwind action is created,...
You have to remember that Storyboards are not an alternative to code. They are a tool that can be used along with coded view, nibs, etc... The real skill comes in using all of these in such a way that takes least effort and gives most maintainability, readability and reliability....
ios,core-data,delay,nsfetchedresultscontrolle,uistoryboardsegue
The problem is that you are using CoreData to store your pictures and apple does not. Though there is no limit on file size and on the total size your library can use it will take longer to get your files than opening a folder in the file structure. This...
ios,uitableview,swift,uistoryboard,uistoryboardsegue
yes. i found it. This problem is optional. :( let indexPath = self.categoryTableView.indexPathForSelectedRow()**!** I put the exclamation point on the end of the line and correct. safe method; if let indexPath = categoryTableView.indexPathForSelectedRow() { // do the work here } ...
ios,storyboard,xcode6,uistoryboardsegue
I have found the solution. For creating custom segue like above, We require to subclass UIStoryBoardSegue class and override the method perform. Below is the code that i have implemented. #import "MyCustomSegue.h" @implementation MyCustomSegue - (void)perform { UIViewController *source = self.sourceViewController; UIViewController *destination = self.destinationViewController; UIWindow *window = source.view.window; CATransition...
ios,objective-c,storyboard,segue,uistoryboardsegue
There are numerous ways you could add a "nice animation". Here is an example of a sort of card shuffle animation where one view moves up and left, while the other moves down and right, then reverses after changing the z-order of the two views. This implementation inserts the destination...
ios,uistoryboardsegue,uianimation,uicontainerview,unwind-segue
Adding a transition definition solved it for me: CATransition *transition = [CATransition animation]; transition.duration = 0.4; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromLeft; [self.navigationController.view.layer addAnimation:transition forKey:nil]; [self.navigationController popViewControllerAnimated:YES]; ...
ios,uitableview,swift,uiviewcontroller,uistoryboardsegue
I found it. You need to use delegates. Look here: http://makeapppie.com/2014/07/01/swift-swift-using-segues-and-delegates-in-navigation-controllers-part-1-the-template/
ios,objective-c,segue,uistoryboardsegue,amslidemenu
I got over the problem by using NSUserDefaults temporarily but still it not a proper solution. Still looking for a proper method to pass parameters b/w classes.
ios,swift,uistoryboardsegue,ios8
The correct pattern to use when accessing the destinationViewController in Objective C or Swift is to cast it to the correct subclass type. This will then allow you to access the subclasses methods and properties. So you should say let myDestVC = segue.destinationViewController as MyViewControllerClass Or in Objective C MyViewControllerClass...
Looks like this behaviour is the result of some - as of yet - undocumented change in recent iOS releases. Getting frustrated with your exact issue and the lack of satisfying answers I've come up with this: // create a UIImageView containing a UIImage of `view`'s contents func createMockView(view: UIView)...
ios,uitableview,swift,segue,uistoryboardsegue
Embed the TableViewController inside the NavigationController. Not the DetailViewController directly. Check out the screenshot. Make sure, that the segue, connecting your TableViewController and your DetailViewController is of type Show (e.g. Push). You have to literally push a new View on top of the Navigationstack. ...
ios,iphone,uitableview,ios7,uistoryboardsegue
First, let me simplify your code -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { PetsTableViewController *pets = [[PetsTableViewController alloc]initWithNibName:@"PetsTableViewController" bundle:nil]; if([petsArray[indexPath.row] isEqualToString:@"Dog"]) { pets.petsInt = 0; [pets setTitle:petsArray[indexPath.row]]; } if([petsArray[indexPath.row] isEqualToString:@"Cat"]) { pets.petsInt = 1; [pets setTitle:petsArray[indexPath.row]]; } if([petsArray[indexPath.row]...
ios,iphone,uitableview,swift,uistoryboardsegue
The problem is that you're not handling your data correctly. If you look into your currentResponse Array, you'll see that it holds NSDictionaries but in your prepareForSegue you try to cast a NSDictionary to a NSArray, which will make the app crash. Change the data variable in RestaurantViewController to a...
ios,objective-c,apple-push-notifications,segue,uistoryboardsegue
Simply send the product (or product ID and then look it up) to the destination view controller via a property: MyViewController* vc = (MyViewController*)[[UIStoryboard storyboardWithName: @"MyStoryboard" bundle: nil] instantiateViewControllerWithIdentifier: @"MyViewControllerIdentifier"]; //have to set the identifier in the storyboard vc.product = product; [self.navigationController pushViewController: vc animated: YES]; Inside MyViewController.h: (class names...
ios,iphone,xcode,swift,uistoryboardsegue
I'm going to go step by step for the process: Make a new project. I used Single View Application for iPhone. Add a second view controller to the storyboard (the panel on the left of the storyboard should look like this). If you don't see the panel click on the...
ios,uiviewcontroller,uinavigationcontroller,uistoryboard,uistoryboardsegue
Embed your first view controller in a Navigation Controller. The reason you can't go back to your first view is because you have your second view embedded in a Navigation Controller, so there is not recognisable way back by using only storyboards; there is no further navigable way back to...