segue

Make Segue programmatically in Swift

女生的网名这么多〃 提交于 2019-11-28 02:38:32
问题 I have two VCs: VC1 and VC2. In VC1, I have a finish button which I programmatically made and a result array I want to pass to VC2. I know how to make Segue in Storyboard, but I cannot do that at this moment since the finish button is programmatically made. If I want to pass result array using segue, is there a way to make the segue programmatically? If this is not possible, should I just present VC2 using presentViewController and set a delegate to pass the result array ? 回答1: You can do it

How to Segue Randomly to ViewControllers in Swift? [closed]

旧巷老猫 提交于 2019-11-28 02:15:41
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . For my Swift app, I'm trying to make it so that a button will lead to a random page in my Main.storyboard but I'm not sure if such a method exists. Is there a way for me to do this? 回答1: Here is how you can segue to a random ViewController . For my example, I chose to use a

Swift performSegue going to Xcode

送分小仙女□ 提交于 2019-11-28 01:46:54
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(withIdentifier: "no", sender:self) } } I have attached my full code incase further analysis is needed. Thanks for

Passing Data to Tabbar Controller

你说的曾经没有我的故事 提交于 2019-11-28 00:54:52
问题 I have a storyboard project and I would like to pass some data from a view into a tab bar controller, the information will be spread out between the tabs. After doing some research I found a very similar issue: iOS storyboard passing data navigationViewController but the only issue with this solution is that it was not transferring to a tab bar controller. I was wondering would I have to pass the data to each tab or can I pass it to the tab bar controller and then spread it from there? Thank

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

旧街凉风 提交于 2019-11-28 00:00:39
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, UIPickerViewDataSource, UIPickerViewDelegate { var delegate: SendDataDelegate! var firstvc = FirstVC() var arr = [

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

你离开我真会死。 提交于 2019-11-27 23:11:55
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? 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-0-x

Can I use multiple segues with one UITableViewDelegate?

守給你的承諾、 提交于 2019-11-27 21:37:28
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? rdurand 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 your tableView's delegate, in didSelectRowAtIndexPath , simply call the segue you want, by checking

Proper way to do “conditional segue” in iOS5

谁说我不能喝 提交于 2019-11-27 20:33:20
问题 I'm trying to write really simple iOS5 app just searching for specific type of data. It contains two screens, the user puts some data in the first, the app checks the data and if it is valid, the app will do a search and show result on new screen. I'm completely new to iOS and storyboards, I read quite a few tutorials, but haven't been able to figure out how to do the checking of input and switching to new screen properly. With iOS5 I guess I should use segue but that's all automatic. Even

IOS StoryBoard multiple Segue's from a TableCell

久未见 提交于 2019-11-27 19:50:06
问题 Hi I have a storyboard and am able to show a detail view when clicking on a table cell. I want to add extra functionality so that depending on what cell I click I show a different view controller. I tried dragging two segues from the same cell but it doesn't allow it. My thinking was that I would have two segue's from the cell each pointing to a different view and then invoke the desired segue: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

How can I segue to the second tab of a tab bar controller from the first tab?

筅森魡賤 提交于 2019-11-27 18:15:46
问题 I have no problem actually performing the segue, but when I do, my tab bar disappears from the bottom of the view. I have made a storyboard segue from TabBarController1 to TabBarController2. I've found a lot of answers for Objective-C, but none for Swift. This is the code for performing the segue: if requestsArray.count == 0 { self.performSegueWithIdentifier("offerSegue", sender: self) } else { self.performSegueWithIdentifier("confirm1", sender: self) } 回答1: You don't want to segue. A segue