segue

Pop the current view using Segues/Storyboard on iOS 5

回眸只為那壹抹淺笑 提交于 2019-11-27 01:08:16
问题 I am creating an app using iOS 5 SDK. I managed to push views using the Storyboard's Segues, but I cannot find the proper way to pop the current view and go back to the previous one. I am not using any navigationController (the app doesn't have any top or bottom bars). I don't think using modal or push segue the other way would be the solution as it instantiates a new controller. Do I have to use a custom Segue with the opposite animation and deletion of the view at the end ? Or is there a

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

て烟熏妆下的殇ゞ 提交于 2019-11-26 23:50:25
问题 I am using presentViewController to present new screen let dashboardWorkout = DashboardWorkoutViewController() presentViewController(dashboardWorkout, animated: true, completion: nil) This presents new screen from bottom to top but I want it to presented from right to left without using UINavigationController . I am using Xib instead of storyboard so how can I do that ? 回答1: It doesn't matter if it is xib or storyboard that you are using. Normally, the right to left transition is used when

Perform Segue programmatically and pass parameters to the destination view

大兔子大兔子 提交于 2019-11-26 23:33:37
in my app I've a button that performs a segue programmatically: - (void)myButtonMethod { //execute segue programmatically [self performSegueWithIdentifier: @"MySegue" sender: self]; } I would like to know if there is a way to reference the destination view and to pass it some parameters. I know that in prepareForSegue method, I can refer to it with: myDestinationViewController *vc = [segue destinationViewController]; , but I don't know how to this executing the segue programmatically. Do you have any ideas? Thanks, yassa UPDATE: I'm sorry for this question!!! I simply discovered that, even if

UITableViewCell indexPath crash in iOS7

走远了吗. 提交于 2019-11-26 23:16:47
问题 I've a UITableViewCell in a UITableViewController . In my cell there is a button that when you click takes you to another view with a prepareforsegue . In prepareForSegue I do this: if ([[segue identifier] isEqualToString:@"MySegue"]) { UITableViewCell *cell = (UITableViewCell*) [[sender superview] superview]; UITableView *table = (UITableView*)[[[sender superview] superview] superview]; NSIndexPath *indexPath = [table indexPathForCell:cell]; } Ok! Everything has always worked well. But now

Can I use multiple segues with one UITableViewDelegate?

本小妞迷上赌 提交于 2019-11-26 23:06:16
问题 I have a UITableView listing multiple types of objects, and I'd like to segue to a different view depending on which type of object the user selects. Is it possible to do this by using multiple segues, and, if so, how? 回答1: Of course ! Define all your segues on your storyboard, by ctrl-dragging from the tableViewController (not a row, the tableViewController itself) to the next view. Give them IDs, so you know which one to call. When all your segues are defined visually, go to the code. In

prepareForSegue called before didSelectRowAtIndexPath only when third segue is added

柔情痞子 提交于 2019-11-26 22:48:00
问题 I have 3 segues to 3 different views. 2 are implemented with no problem, it is when the third is created that the problems occur. I have the following didSelectRowAtIndexPath method: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ NSLog(@" ---------- did select row"); if(indexPath.section == 0){ if(indexPath.row == [self.data count]-1){ //prior to adding this, everything works [self performSegueWithIdentifier:@"MoreComments" sender:self]; }else{

iOS 6 - can i return data when i unwind a segue?

假如想象 提交于 2019-11-26 22:45:36
问题 I have created a simple unwind segue using the storyboard tools. I have created the following event handler in the view I want to unwind to: -(IBAction)quitQuiz:(UIStoryboardSegue *)segue { NSLog(@"SEGUE unwind"); } This fires correctly and unwinds the segue (the message gets logged). When the user quits the quiz I would like to pass some data back and have been struggling with how to achieve this. Can anyone advise? 回答1: Thanks Jeff. After watching WWDC video 407 I have a clear solution. In

Swift performSegue going to Xcode

余生长醉 提交于 2019-11-26 21:59:43
问题 I am trying to perform a Segue between two UI Views I have correctly typed the identifier for the segue as can be seen Here This is my function, with the same identifier "no" but when the button is clicked in the simulator it simply shows This (It looks like it is showing the stack in bottom left?) func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) { if control == view.rightCalloutAccessoryView { performSegue

Passing data between two ViewControllers (delegate) - Swift [duplicate]

删除回忆录丶 提交于 2019-11-26 21:39:54
问题 This question already has an answer here: Passing Data between View Controllers 42 answers I have two ViewController's. FirstVC - I have label and button with segue "modal" SecondVC - I have PickerView and button (back to FirstVC): @IBAction func bntback(sender: AnyObject) { self.dissmissViewControllerAnimatied(true, completion: nil) } And I created delegate in SecondViewController as: protocol SendDataDelegate { func sendData(text:String) } Next: class SecondVC: UIViewController,

Instead of push segue how to replace view controller (or remove from navigation stack)?

心不动则不痛 提交于 2019-11-26 21:25:23
I have a small iPhone app , which uses a navigation controller to display 3 views (here fullscreen ): First it displays a list of social networks (Facebook, Google+, etc.): Then it displays an OAuth dialog asking for credentials: And (after that, in same UIWebView ) for permissions: Finally it displays the last view controller with user details (in the real app this will be the menu, where the multiplayer game can be started): This all works well, but I have a problem, when the user wants to go back and select another social network: The user touches the back button and instead of being