segue

From XIB to Storyboard

£可爱£侵袭症+ 提交于 2019-12-03 16:28:55
I got an app with a storyboard and one window in .xib. From the storyboard to the .xib i move in that way: ShowDreamNIBController *detailViewController = [[ShowDreamNIBController alloc] initWithNibName:nil bundle:nil]; [self presentModalViewController:detailViewController animated:nil]; How can i move back from the .xib to the storyboard? And one more question. Can i send some information when move to the .xib from storyboard? Like i do it throught segues in prepareForSegue method UPD I got answer about closing .xib. Need answer about sending information. you can get back to your storyboard by

How to get reference to UIPopoverController when using adaptive segue?

蓝咒 提交于 2019-12-03 15:51:47
问题 In my iOS 7 app, I detected if a segue was a popover via this check in prepareForSegue : if ([segue isKindOfClass:[UIStoryboardPopoverSegue class]]) But now that I am using adaptive segues, the Present as Popover segue is no longer returning true in the above check. This is because segue is no longer a UIStoryboardPopoverSegue , instead it is a UIStoryboardPopoverPresentationSegue . However, one cannot simply add the Presentation word because that's not defined. What is the appropriate way to

instantiateViewControllerWithIdentifier and pass data

拈花ヽ惹草 提交于 2019-12-03 14:37:50
I am using Storyboard in my app and I want to pass data from one view to another view. Instead of using segues I am using instantiateViewControllerWithIdentifier . In this case I am instantiate from my first TableViewController to a NavigationController which has a second TableViewController attached because I need the navigation in the second TableViewController . Now I want to pass data from my first TableviewController , depending which row was clicked, to my second TableviewController . In this case newTopViewController would be my NavigationController but my problem is now how to pass

viewWillAppear called twice with custom segue animation using transitionFromView

此生再无相见时 提交于 2019-12-03 13:57:32
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 *source = self.sourceViewController; UIViewController *destination = self.destinationViewController;

UIViewController half screen “drawer slide” animation

馋奶兔 提交于 2019-12-03 12:57:18
I am trying to have a UIViewController that appears with a "slide" animation from the right. Not like a Push segue, not like the Facebook app. I want the new ViewController to slide ON TOP of the current one (not push it away), but only cover PART of the screen, leaving the other part showing the first ViewController. What I have tried: The closest that I have gotten is by creating a custom segue with the following: - (void)perform { __block UIViewController *src = (UIViewController *) self.sourceViewController; __block UIViewController *dst = (UIViewController *) self

Custom UITableViewCell not calling prepareForSegue

帅比萌擦擦* 提交于 2019-12-03 12:19:27
I have a custom UITableViewCell, called EventCell . EventCell.h #import <UIKit/UIKit.h> @interface EventCell : UITableViewCell @property (nonatomic, strong) IBOutlet UILabel *titleLabel; @property (nonatomic, strong) IBOutlet UILabel *locationLabel; @property (nonatomic, strong) IBOutlet UILabel *dateLabel; @property (nonatomic, strong) IBOutlet UILabel *typeLabel; @end EventCell.m #import "EventCell.h" @implementation EventCell @synthesize titleLabel, locationLabel, dateLabel, typeLabel; - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self =

Modal segue needs 2 clicks instead of one

元气小坏坏 提交于 2019-12-03 12:08:56
My UITableView needs 2 clicks to show the detail page of the selected cell : one for selection and another one for show the detail view. I would like one clic to directly show the detail view of the clicked cell. I use a modal segue with this method inside my UITableViewManager.m : - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"showDetail"]) { NSIndexPath *indexPath = [playerList indexPathForSelectedRow]; TCPlayerStat *object = _objects[indexPath.row]; [[segue destinationViewController] setPlayerStat:object]; } } I can't work

Unwind segue function with Back button

时间秒杀一切 提交于 2019-12-03 11:21:59
I'm trying to call function when i'm pressing default Back button (e.g. < Settings ) in Navigation Controller. At other situations i'm creating custom button, after i'm Ctrl+Dragging to red Exit button in XCode and pointing it to Selection segue. Now i need to use default back button of navigation controller, but i can't set assign it to segue action because it's no back button in Storyboard view (but it exists in Simulator). Simulator: XCode: I can create custom button in navigation contoller and assign it so custom unwind segue, but that button will be ugly without "< " symbol. I've found

PerformSegueWithIdentifier does not work

人走茶凉 提交于 2019-12-03 10:44:31
I am trying to use use self.performSegueWithIdentifier to change the view on the Storyboard when a JSON file loaded remotely. For this I am using the Swift Class "Agent" to perform the HTTP request. Everything is working when I write the self.performSegueWithIdentifier("toView2", sender: self) out of the "done" variable. Why is it not working? I guess it has something to do with the "sender: self". But I don't know how to solve this. I don't get any errors on Xcode. It just loads the data from my server and then nothing happens... @IBAction func goToView2(sender: AnyObject) { let done = {

Swift: Creating a button that calls a method in another class1

霸气de小男生 提交于 2019-12-03 08:56:35
I have 2 classes, the first class is named "store" where I create a button which calls a method: "storeSelected" located in the second class with the name ExploreViewController . The method should print "done" and take me to another view controller. Without the segue "done" is printed but when putting the segue code the app crashes. The error is: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<Glam.ExploreViewController: 0x14ed3be20>) has no segue with identifier 'ok'' ......... // ExploreViewController Class let _sharedMonitor: ExploreViewController