segue

Passing data while dismissing a view

*爱你&永不变心* 提交于 2019-12-12 04:23:41
问题 I'm working on an app with two different views which can modally present a "settings" viewController with a tableView embedded in it. To pass the data from the embedded tableView to the first two views I would have to use prepareForSegue in each view transition (to my understanding). However, when I'm in the Settings view and tap on "Done" I want to go back to the view I was before. In order to do this one would have to dismiss the view as far as I know. Can I pass data from one view to

Tab Bar Lost When Switching Views

时光总嘲笑我的痴心妄想 提交于 2019-12-12 04:23:40
问题 I have two views that are embedded inside navigationController s. One of these views is also embedded inside a tabController . When I switch back and forth between the two views, I lose the tabBar that was originally on one of the views. What is the best way to go about fixing this issue? I am currently using a segue at the moment and am at a loss. 回答1: I would change my navigation controller to be the root view controller, or have the tab bar segue go to the navigation view controller first

How to pass data from one view controller to another?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 04:21:55
问题 How do I pass the data from an array of one view controller to another view controller? FirstViewController : var myArray = ["some data"] override func prepare(for segue: UIStoryboardSegue, sender: Any?){ let destinationVC = segue.destination as! SecondViewController destinationVC.passedArray = myArray } SecondViewController : var passedArray = [String]() override func viewDidLoad(){ super.viewDidLoad() print(passedArray) } 回答1: You can try this Solution for Data Transfer. In

How to present VC modally then segue to a VC that's embedded in a Navigation Controller

谁说我不能喝 提交于 2019-12-12 04:19:39
问题 My app flow is like this: (1) The app launches you into a LogInViewController that is embedded in a NavigationController . (2) Inside LogInViewController if runCount < 1 I want to present a set of tutorials VCs that are not embedded in a nav stack. (3) You can tap "skip" or after swiping through the tutorial VCs you tap an "OK" button , all of which segue you back to LoginViewController . The problem is that when you are segued back to LogInViewController there's no NavigationController .

How do I access the current annotation's NSString when in “prepareForSegue”?

▼魔方 西西 提交于 2019-12-12 04:13:45
问题 Pin .h #import <Foundation/Foundation.h> @import MapKit; @interface Pin : NSObject <MKAnnotation> { NSString *time; CLLocationCoordinate2D coordinate; } @property (nonatomic, copy) NSString *time; @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @end Pin.m #import "Pin.h" @implementation Pin @synthesize coordinate; @synthesize time; @end How I set my Pin in the view Pin *newPin = [[Pin alloc]init]; newPin.coordinate = userCoordinate; NSDate *currentTime = [NSDate date];

How to stop slide transition into Second VC before it covers UIView?

允我心安 提交于 2019-12-12 04:02:47
问题 In my application I have a uiview at the top of the screen. When I tap that UIView I have a second View Controller slides up. What I would like to accomplish is that when the second View Controller slides into the screen it stops right before it covers up the UIView What I am trying to accomplish is have a view slide up that contains store information such as hours open, address, phone number etc. So I was thinking that I could just have another view controller that holds all of this

How to configure animated in custom segue in iOS using swift?

混江龙づ霸主 提交于 2019-12-12 03:59:00
问题 I have a created a custom segue like below class DismissSegue: UIStoryboardSegue { override func perform() { sourceController.dismissViewControllerAnimated(true, completion: nil) } } In some scenarios I want to dismiss my currentVC without animation but in some cases with animation. How does it possible? I tried setting up @IBInspectable but no luck it doesn't show up property in storyboard. Any kind of help is appreciated. Thanks. 回答1: A couple of thoughts: If you are determined to use your

Chain two segues to look like one

时光怂恿深爱的人放手 提交于 2019-12-12 03:24:19
问题 I have this structure in story board (lines represents segues): B / A \ C I want to use A (view controller) as a "hub". But I want to say in C that I want to B . I'll set next target (doesn't matter how) and perform unwind from C to A which know where to go next, and in unwind target action it calls ther right performSegueWithIdentifier but nothing happens. This was supposed to be an proof of concept and it would results in two animations. The target solution would be for user to transition

Segue from one ViewController to another ViewController inside a Tab Bar Controller?

送分小仙女□ 提交于 2019-12-12 03:17:55
问题 In the interface builder I have a UITabBarController and it is set as the initial view controller. From the tab bar controller, I have linked three independent ViewControllers; two UIViewController 's and one UITableViewController . I have embedded all three of these views inside UINavigationController 's as each of these views will eventually segue to a new view. Interface Builder Problem: I now want to link one of the UIViewController 's to the UITableViewController using a button to segue

Pushing data through UITableViewcell with unwind segues

我与影子孤独终老i 提交于 2019-12-12 03:07:35
问题 I have a push segue that i use to transfer data from a uitableview cell to text fields. The app plan is that the user will enter data into a text field, then they will click on a button and it will modal segue over to a table view controller, then they will select a uitableviewcell and it will be transferred back to the original view where they had entered the data into the text field and the tableviewcell content will be entered into different text fields on the same view. But i am