segue

Hiding a Segue on Login process

无人久伴 提交于 2019-12-06 14:19:51
问题 after finding a good solution about a missing Segue execution thanks to this post I'm clashing against another problem: Following the approach described in the aforementioned post I'm performing the check for my auth token in the Dashboard VC and,if not set,I activate a segue pointing to the LoginVC exploiting the delegate mechanism in order to dismiss the view once the operation is completed. Now,the problem is that on the very first run I got the Dashboard VC show for a moment before the

Storyboard & Segue - Passing datas am i doing it good?

荒凉一梦 提交于 2019-12-06 13:43:18
I'm using Storyboards & segues. I want to switch from "Contacts List" (tableView) to a "Profile view" (ScrollView). Three questions : Is this the best way (more clean & beautiful) to do this ? & Why ? When i do this : ProfileViewController *aProfileView = (ProfileViewController *)[segue destinationViewController]; is this instantiate a new view ? (Like it will create 2 Profile view). do i need to clean (delete the "Profile View" somewhere ?) or it's doing it alone with the Navigation controller ? // Code - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue

self.dismiss does nothing on 3rd level segue

∥☆過路亽.° 提交于 2019-12-06 12:13:42
I have a view controller embedded in a navigation controller. I segue to a view controller via a "show" segue. From there I navigate to a tableviewcontroller via a "show" segue. The navigation bar shows up with the back button but upon didclickrow self.dismiss does nothing. The completion block never executes. I'm baffled. There has to be some rule I don't understand about view controllers. self.dismiss(animated: true, completion: { print( "THIS NEVER EXECUTES AND NOTHING HAPPENS" ) }) hardik parmar The "show segue" is used to push a view controller. So your code will not work as you are

Segue to current view UItableView

别来无恙 提交于 2019-12-06 12:07:41
I have an undefined number of levels (depth) in my tableview, so i'd like to be able to create a segue between the view and itself so that i can call it as long as i have sub levels to discover. How can i do that ? I've thought of directly using [self.navigationView pushViewController] when i need it, but i'd like the new controller to use the defined view in my SB. Thanks, EDIT: For now the only solution i've found is duplicating the VC, setting a segue between VC1 and VC2 called 'showNext', and a segue between VC1 and VC2 called the same way. Isn't there a better solution ? Rob If you're

Polymorphism in Storyboard ViewControllers

瘦欲@ 提交于 2019-12-06 11:12:14
I am wondering how can I implement polymorphism in the iPhone XCode storyboard ViewControllers. This is my problem: Two different ViewControllers in my application are segueing to a common ViewController. This common ViewController is behaving differently depending on the VC it was segued from - different remote API server calls and CoreData fetches are performed (for the first it presents all users in a table, for another it presents a list of admins - subclass of users, and I may have a third one that will presents filtered list of users). This common ViewController is very centric in my

Perform segue from button in XIB

血红的双手。 提交于 2019-12-06 10:10:54
I'm using storyboards for the most of my project, but i have one UIScrollView that consists of multiple views that are loaded from XIB I'm stuck on how to perform a segue when a button is clicked in the XIB What i've done already. Added the views to a scroll view Added a custom button added an IBAcion on the custom button MainViewController NSString *nibName = @"coverArticleView"; NSArray *nibObjects = [NSBundle.mainBundle loadNibNamed:nibName owner:self options:nil]; coverArticle *pageView = [nibObjects objectAtIndex:0]; pageView.articleTitle.text = ob.Title; pageView.articleTitle

SpriteKit: Passing variable from GameViewController to GameScene

孤街浪徒 提交于 2019-12-06 09:36:14
I created a menu in Storyboard that passes some information through a segue to GameViewController. Ideally, I could use that segue to pass the information directly to GameScene.swift where I need it, but I'm not sure that's an option since a scene is just a view and not a view controller. So, I pass the information to the GameViewController and that works great. But now, how to I get it to GameScene.swift? Segue from menu to GameViewController func passToGame(game: String) { performSegue(withIdentifier: "toGameSegue", sender: game) } override func prepare(for segue: UIStoryboardSegue, sender:

Correct way of removing (deleting) a view/viewController from the stack after segue in Swift

女生的网名这么多〃 提交于 2019-12-06 07:57:07
问题 I am running into a problem here. I am presenting views with performSegueWithIdentifier . Everything goes smoothly. The problem is that as a test, I only have 2 viewControllers with some data in them and I have two buttons that call a segue back to the other VC. If I keep performingSegues, you can clearly see that the memory usage goes up every two segues by around 0.4Mb. This tells me that the Views are not being deleted/removed from the view stack and are just using memory. I would like to

Swift - Perform Segue from map annotation

青春壹個敷衍的年華 提交于 2019-12-06 07:15:43
问题 I have 1 pin on my map. I need to pass title of annotation to another UIView (which is ikinciEkran.swift in that case). But I am unable to do so. Here is the segue part of my code and I do not know how to segue title of selected annotation. I only pasted related part of the code. class MapViewController: UIViewController, CLLocationManagerDelegate, MKMapViewDelegate { @IBOutlet weak var mapView: MKMapView! @IBOutlet weak var lbl_Name: UILabel! @IBOutlet weak var lbl_Address: UILabel!

Could not cast value of type 'UITableViewController' to 'UINavigationController'

早过忘川 提交于 2019-12-06 06:25:16
I'm trying to segue from one view controller to another, and pass data to the next controller. But I keep getting this error: Could not cast value of type 'UITableViewController' to 'UINavigationController' override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) { if (segue.identifier == "segueLogWaterData") { // pass data to next view let nav = segue.destinationViewController as! UINavigationController let segueViewController = nav.topViewController as! WaterDataViewController } } This happens with WaterDataViewController as a UITableViewController . I've also tried