uistoryboardsegue

Swift: programmatically enumerate outgoing segues from a UIVIewController

浪子不回头ぞ 提交于 2019-12-18 06:59:15
问题 I want to list the outgoing segues from a UIViewController, as described in Programmatically enumerate outgoing Segues for a UIViewController, but in Swift. (Swift 2, Xcode 7, iOS8+). I can do override func viewDidLoad() { super.viewDidLoad() let s = valueForKey("storyboardSegueTemplates") print("switchingVC: segues: \(s)") } and that produces output like switchingVC: segues: Optional(( "<UIStoryboardPresentationSegueTemplate: 0x1754a130>", "<UIStoryboardPresentationSegueTemplate: 0x17534f60>

How do you perform a customized segue (modal segue) from a UIButton in storyboard

喜夏-厌秋 提交于 2019-12-17 18:22:18
问题 I would like to segue a destination scene through a button present in source scene. I also would like to have a control of the transition animation between the viewcontroller (I want to animate the 2 views from right to left). Is it possible to do so through the replace segue? I try both the replace segue and the push segue but the segue is not happening any suggestion how i should proceed there? Thanks! 回答1: I found out that the replace segue and push segue were misleading because the

Passing variables between view controllers

混江龙づ霸主 提交于 2019-12-17 10:59:32
问题 I am using this function to switch between views in Xcode 4.3. [self performSegueWithIdentifier:@"NextView" sender:self]; I would like to pass some parameters between pages. How can I do that? 回答1: After performSegueWithIdentifier:sender: your view controler will call - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender assuming your new view controller has some propertys to set: if ([[segue identifier] isEqualToString:@"NextView"]) { MyViewController *myVC = [segue

How to execute some code after a segue is done?

a 夏天 提交于 2019-12-17 10:56:29
问题 Is it possible in iOS 6 to know when a UIStoryboardSegue has finished its transition? Like when i add a UIStoryboardSegue from UIButton to push another UIViewController on the navigationcontroler, i want to to something right after the push-transition is finished. 回答1: You can use the UINavigationControllerDelegate protocol and then define: – navigationController:didShowViewController:animated: 回答2: In case you don't want to use the viewDidAppear: method, you could create a custom segue. In

Custom Segue Animation

时间秒杀一切 提交于 2019-12-17 10:29:50
问题 I am trying to use a custom segue to perform a kind of zoom animation. When the transition is executed, the sourceViewController goes black, then the zoom occurs. Tried also to set the pushViewController: into the completion block but the transition is not executed at all. - (void)perform { UIViewController *sourceViewController = (UIViewController *) self.sourceViewController; UIViewController *destinationViewController = (UIViewController *) self.destinationViewController;

Storyboard segues causing memory leaks

狂风中的少年 提交于 2019-12-17 09:42:46
问题 I have two UIViewControllers with buttons triggering segue (modal) to each other. I wanted to discover if that's causing any memory leaks while jumping back and forth and I see that Living Object && allocated memory is going up, what eventually would leave to app crash. I don't have any single line of code - working with pure UIViewControllers. What I might be doing wrong? Could have I set something wrong in project settings? Am I reading profiler's statictics badly? Do I need to make any

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

烂漫一生 提交于 2019-12-17 05:36:08
问题 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

IOS/Objective-C: Custom Segue Effect on Navigation Bar Compared with Show Segue

二次信任 提交于 2019-12-14 04:06:05
问题 I have two view controllers where I use a regular Show Segue (Right to Left) to go in one direction and a custom segue (Left to Right) to go in the other direction. I don't think I should do an unwind because neither VC is subordinate to other and using these segues means one navigation controller manages things. In the upper left hand corner of both VCs I have a common BarButton containing a profile photo. When using the regular Right to Left Segue, the profile photo on the bar button

How to perform segue inside unwind function

本秂侑毒 提交于 2019-12-13 19:13:52
问题 I have 3 MVCs and name them A, B, C here. A is the main MVC with a button "Menu" connected to B with popover segue. A also connected to C with a manual show segue. B is a popover MVC with a button "Detail" connected to A with unwind segue. C is the detail MVC with detail info. Inside the unwind function of A. I call performSegueWithIdentifier to show C. Expected behavior is Click "Detail" button in B B disappear and A show up C show up But running the app I got. Click "Detail" button in B B

How to pass data between view controllers - not working

南笙酒味 提交于 2019-12-13 10:56:25
问题 Im trying to pass an player score from VC1 to a view that displays the current scores of all players(4). the display view is on a separate view controller than where the player(s) score is defined and stored. I have done the prepare(segue) and im able to pass other variables to the display VC(ThirdViewController). but when I try to assign the player score to the uilabel.text It tells me that I have unwrapped a nil value I have even tried to just set the label text to a static string and still