segue

Unwind from a VC to a TabBarController and change tab index

。_饼干妹妹 提交于 2019-12-31 05:40:15
问题 I have the following Storyboard layout: When the app starts it goes to HomeView VC at TabIndex 1. In the HomeView I have a button and I segue to the TestView using performSegue(withIdentifier: "goToStartTest", sender: self) Now I want to go from TestView to HistoryView . The only way I can see to do that right now is to create a segue from TestView to TabBarController . This brings up HomeView with Tab Bar intact. I do this from TestView using performSegue(withIdentifier: "testToRes", sender:

(Xcode 6 beta / Swift) performSegueWithIdentifier has delay before segue

可紊 提交于 2019-12-31 00:50:05
问题 I'm just learning Ios programming for the first time, with Swift and Xcode 6 beta. I am making a simple test app that should call an API, and then segue programmatically to a different view to present the information that was retrieved. The problem is the segue. In my delegate method didReceiveAPIResults , after everything has been successfully retrieved, I have: println("--> Perform segue") performSegueWithIdentifier("segueWhenApiDidFinish", sender: nil) When the app runs, the console

Is prepareForSegue right way of passing value between view controllers

廉价感情. 提交于 2019-12-30 06:38:05
问题 I'm trying to learn Swift and I'm trying to develop the famous note application. There is an array bound to a tableview and another view for adding notes. At second view textfieldshouldreturn event triggers a segue and goes back to tableview. I wanted to learn if this is the right way. Because by doing this way I'm manipulating a variable in another view controller. I'm not a MVC master but I felt like it is wrong. Here is my code snippet: func textFieldShouldReturn(textField: UITextField) ->

Pass a UIWebView request using prepareForSegue

我与影子孤独终老i 提交于 2019-12-30 05:29:10
问题 I 'm new to IOS and Objective C. The scenario is I have 2 buttons, which open (with segue) 2 view controllers containing a UIWebview. I thought is better to do it with 1 UIWebView so I tried to pass the request object of the webvew and use only one webview controller. so I got the wwwBtn (UIButton that opens a site) and fbBtn (UIButton that goes to a Facebook URL) my viewController and the wwwWebViewController which contains th UIWebView. Here is how I did it. The viewController.h file :

Prepare for Segue to UITabBarController Tab

我与影子孤独终老i 提交于 2019-12-30 04:58:07
问题 I want to pass information from a ViewController to a UITabBarController so that I can access certain information from the view controller in the 3rd tab of the UITabBarController . However, the issue is my program keeps crashing when I try to do so. Here is my code so far: I call the segue like so: self.firstName = user.first_name self.lastName = user.last_name self.performSegueWithIdentifier("OffersView", sender: self) And I override the prepareForSegue function so that I can pass

Programmatically segue from UIBarButtonItem

梦想的初衷 提交于 2019-12-29 08:48:14
问题 I have three view controllers, all with two buttons each on the right and left sides of the navigation bar, as seen below on one of them. I'm creating these buttons programatically, and instead of writing the code in each respective view controller (VC) I decided to write a Helper class that creates the buttons. // Note: I am using FontAwesome as a third-party library. class Helper: NSObject { static func loadNavBarItems(vc: UIViewController) { let profileButton = UIBarButtonItem() let

How to perform segue from within a SKScene?

坚强是说给别人听的谎言 提交于 2019-12-29 01:33:09
问题 I have been trying to perform a segue from within a sprite kit SKScene layer. My application requires the user to touch an image on the scene that would push up a new UIViewController. But every time I try to perform from within the SKScene game layer, it gives me output with has no segue with identifier error. I do have a segue and have specified it with an identifier. My simple question, how can one perfrom segue with a SKScene game layer running? Please help me out. 回答1: Segues belong to

prepare(for segue: UIStoryboardSegue, sender: AnyObject?) missing in swift 3.0/Xcode 8 b6

泪湿孤枕 提交于 2019-12-28 06:24:26
问题 Using xcode 8 beta 6. Type override func prepare and I see this .. But I am looking for prepare(for segue: UIStoryboardSegue, sender: AnyObject?) Is this a bug? This class is a subclass of ViewController? 回答1: Maybe this was a bug in Beta 6. I'm using the GM seed, and it is working: BTW: In beta 6, the method was renamed to prepare(for segue: UIStoryboardSegue, sender: Any?) 来源: https://stackoverflow.com/questions/39469915/preparefor-segue-uistoryboardsegue-sender-anyobject-missing-in-swift-3

can i use to pass a data with 'navigation controller back button' in xcode

那年仲夏 提交于 2019-12-27 05:07:52
问题 i have 2 view controller and a navigation controller . we shall say main for 1 and detail for 2. when i push button in main, detail opens and main opens with back button well, i want to change a label text or a string in main view controller when i clicked a button and back button on detail view controller. how can i make this? if([segue.identifier isEqualToString:@"deneme"]) { MainViewController *main=[segue destinationViewController]; main.detay=@"denme"; } i tried prepareForSegue and

How can I pass a variable from one view to another easily?

别说谁变了你拦得住时间么 提交于 2019-12-25 17:44:55
问题 So I want to be able to pass a variable from one view to another view easily. I've seen ways by doing it via a Segue but I was hoping for something simpler than that if possible. Is there any way to just transfer the content of one variable and save it in another view really easily. I am aware this might not be possible. If this isn't possible, please could someone explain how to use the Segue method? I've seen various online tutorials explaining how to do it but they are all applying it to a