uistoryboardsegue

How to get the indexpath of a custom table view cell when an UIImage inside of it is tapped and captured by UITapGestureRecognizer in prepareForSegue

若如初见. 提交于 2019-11-29 18:13:11
Ok a lot of variables in the title, sorry I couldn't make it any more simpler. First, I have a custom table cell with descriptions like so now, when a user taps on the cell itself, it would go to View A, however, there is a UITapGestureRecognizer that is connected to the UIImage at the left, which is connected to a segue that goes to View B. All is fine, but I need some data that is inside the table view cell that I can pass to View B so it can do some stuff once the view is shown. override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if(segue.identifier == "toViewA") {

'Show' segue in Xcode 6 presents the viewcontroller as a modal in iOS 7

情到浓时终转凉″ 提交于 2019-11-29 16:03:42
问题 I have two view controllers in my iPhone application (built with swift) built with Xcode 6.1 and uses storyboards. The first view controller is embedded in a navigation controller in the storyboard and the segue for the second view controller is a 'Show' segue. When the application is run, it properly shows the transition as a push in iOS 8.x, but in iOS 7.x it appears as a modal without the navigation bar. My application requirement is to show the transition as a push regardless of whether

push to another view controller without prepareForSegue

南楼画角 提交于 2019-11-29 09:25:35
问题 How can you push to another view controller without prepareForSegue ? myClassVC *viewController = [myClassVC alloc]; UIStoryboardSegue *segue = [[UIStoryboardSegue alloc] initWithIdentifier:@"pushToMyVC" source:self destination:viewController]; if ([segue.identifier isEqualToString:@"pushToMyVC"]) { NSLog(@"logging"); myClassVC *viewController = (myClassVC *)[segue destinationViewController]; [self presentViewController:viewController animated:YES completion:nil]; } 回答1: If you want to

Xcode 4.2 iOS 5 : Multiple segues from a UITableView

拜拜、爱过 提交于 2019-11-29 08:32:22
问题 I'm starting now with Xcode on 4.2 for iOS5 and there are a few changes and I'm now crossing a problem that I can't figure out a way to solve it. I'm doing an example with a UITablwView that is populated programmatically with 2 Sections, 1st section with only 1 Row, and 2nd Section with 3 Rows. My aim is to select a row from the table, and based on that row, the user will be redirected to different Views. For example: selecting section 0 row 0, app pushes to view 1 - name setting // selecting

How to know the current storyboard name?

心已入冬 提交于 2019-11-29 05:51:36
I want to know what is the current loaded storyboard,I used the below code but it is still get me the Main storyboard not the current. //This get me the Main storyboard [[NSBundle mainBundle].infoDictionary objectForKey:@"UIMainStoryboardFile"]; If you are working in a UIViewController class that is instantied or segues through the storyboard the most simple way is : UIStoryboard *storyBoard = self.storyboard; If you are in a UIView class that is in a UIViewController UIResponder *responder = self; while (![responder isKindOfClass:[UIViewController class]]) { responder = [responder

Passing variables between Storyboards without Segues - Swift

喜你入骨 提交于 2019-11-29 02:31:09
I'm passing data between two different UIViewControllers located within two different .storyboard files within Xcode. (It's quite a large project so I had to break it up into different storyboards.) I have already established an "exercisePassed" variable (String) within the view I would like to Pass my data to, and I already know how to move between two views located within different storyboards. Like so. var storyboard = UIStoryboard(name: "IDEInterface", bundle: nil) var controller = storyboard.instantiateViewControllerWithIdentifier("IDENavController") as! UIViewController //***************

How to check if a view controller can perform a segue

狂风中的少年 提交于 2019-11-29 02:11:02
问题 This might be a very simple question but didn't yield any results when searching for it so here it is... I am trying to work out a way to check if a certain view controller can perform a segue with identifier XYZ before calling the performSegueWithIdentifier: method. Something along the lines of: if ([self canPerformSegueWithIdentifier:@"SegueID"]) [self performSegueWithIdentifier:@"SegueID"]; Possible? 回答1: As stated in the documentation: Apps normally do not need to trigger segues directly.

Custom Push Segue removes navigation bar and tab bar in story board

别说谁变了你拦得住时间么 提交于 2019-11-28 23:20:02
I have the following defined in a custom Segue, let us call it SegueX: @interface SegueX : UIStoryboardSegue @end @implementation SegueX - (void)perform { CATransition* transition = [CATransition animation]; transition.duration = 0.3; transition.type = kCATransitionFade; [[self.sourceViewController navigationController].view.layer addAnimation:transition forKey:kCATransition]; [[self.sourceViewController navigationController] pushViewController:[self destinationViewController] animated:NO]; } @end In my story board I have just changed a standard Push segue to SegueX. For some reason this will

Pushing to a Detail View from a Table View Cell using Xcode Storyboard

人盡茶涼 提交于 2019-11-28 22:24:15
问题 I have a table view inside a View Controller. I can populate all my information inside the table view. However I am a bit lost for setting up the detail views. I believe each table cell needs a segue to a each detail view but not completely sure. Here is my code. What am I missing to accomplish the segue from the table view to the detail views? Code: .h @interface DetailViewController : UIViewController <UITableViewDelegate,UITableViewDataSource> { IBOutlet UITableView *myTable;

Push segue from UITableViewCell to ViewController in Swift

喜你入骨 提交于 2019-11-28 20:48:53
I'm encountering problems with my UITableViewCells. I connected my UITableView to a API to populate my cells. Then I've created a function which grabs the indexPath.row to identify which JSON-object inside the array that should be sent to the RestaurantViewController . Link to my Xcode Project for easier debugging and problem-solving Here's how my small snippet looks for setting the "row-clicks" to a global variable. func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { i = indexPath.row } And here's my prepareForSegue() function that should hook up my push