uistoryboardsegue

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;

iOS 10 Messages Extension - Wrong Layout when using Storyboard Segue

一笑奈何 提交于 2019-12-03 12:45:42
When using Segues in Messages Extension Application the layout gets messed up. Is there any way to solve this issue while still using storrybord segues? Screenshots: (Note: The first and second View / ViewController are identical. The segue-type doesn't matter) Expanded Presentation Style: Compact Presentation Style: Update 1: The top and bottom layout guides reset after a segue compact: top: should be: 0 but is: 20 bottom: should be: 44 but is: 0 expanded: top: should be: 86 but is: 20 bottom: should be: 44 but is: 0 P.S. Can someone create a new "messages-extension" tag? I hope this won't

UITableView “selection” triggered segue

三世轮回 提交于 2019-12-03 12:31:28
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? The prepareForSegue:sender: method's sender parameter is the cell you are looking for. You can get it's index path by [self.tableView

How unwindForSegue:towardsViewController: works?

余生颓废 提交于 2019-12-03 09:58:57
问题 In my simple app, I have created some controllers with basic segues between them: Yellow controller -> BlueController -> GreenController -> OrangeController . Every of them has its own custom class. From OrangeController I created unwindSegue to my YellowController . It is ok. Within every class I put: override func unwindForSegue(unwindSegue: UIStoryboardSegue, towardsViewController subsequentVC: UIViewController) { print(unwindSegue) print(subsequentVC) } But it was not called at all. Why?

performSegueWithIdentifier in swift [closed]

心已入冬 提交于 2019-12-03 09:24:43
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . If I have this Objective C code: [self performSegueWithIdentifier:@"push" sender:self]; and - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if([segue.identifier isEqualToString:@"push"]) { } What is the Swift equivalent? 回答1: self.performSegueWithIdentifier("push", sender:

Displacing one view with another with a custom segue animation?

痞子三分冷 提交于 2019-12-03 09:13:24
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 time as current view falling to bottom but failed. src.view.transform=CGAffineTransformMakeTranslation(0,

Separate Button action and segue action

可紊 提交于 2019-12-03 07:56:38
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. 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 performSegueWithIdentifier: method, using the meaningful name you chose earlier. From your comments, it

How to pass data to another controller on dismiss ViewController?

不羁岁月 提交于 2019-12-03 07:44:12
问题 I want to pass my data from one ViewController to another VC on VC dismiss. Is it possible? I've tried the next method and no success: On button click: self.dismiss(animated: true) { let storyboard = UIStoryboard(name: "Main", bundle: nil) let controller = storyboard.instantiateViewController(withIdentifier: "EditViewController") as! EditViewController controller.segueArray = [values] } when EditViewController appears again, my segueArray is nil there. How can I pass my data from my

Swift: Force show Navigation Bar in Modal

可紊 提交于 2019-12-03 05:42:07
I have the following Storyboard Segue in my Swift project: The animation is correct, but there is no navigation bar in the destination view controller. I want to force the destination view controller to have a navigation bar. I tried in the destination view controller: override func viewWillAppear(animated: Bool) { super.viewWillAppear(true) navigationController?.navigationBar.hidden = false } Or: override func viewWillAppear(animated: Bool) { self.navigationController?.setNavigationBarHidden(false, animated: true) } But it refuses to show any navigation bar. How can I perform a vertical segue

NSInvalidArgumentException reason Receiver has no segue with identifier

别说谁变了你拦得住时间么 提交于 2019-12-03 05:40:17
I have problem I've been sitting with. I have a UIViewController List and a UIViewController Login . On Login I have a button "Done", also another hidden button on the same UIViewController that has a segue to List (Type: push). I gave it an identifier in the interface builder of xcode named "LoginToList". Now from another class (a class that runs while Login is the active controller) I call: [[Login sharedLogin] performSegueWithIdentifier:@"LoginToList"]; The Login class clearly has a segue with identifier "LoginToList" Yet I keep getting: 'NSInvalidArgumentException', reason: 'Receiver (