FAQ Database Discussion Community


Custom cell segue with data pass error - Swift

swift,tableview,cell,segue
I am creating a quiz app and the table view presents the user with the questions they got right / wrong. When the user taps on a question it takes them to a new page that displys the explanation of the question. For clarification: I have correctly labeled my segue...

Why is my variable is changing in printLn but not in the tableview Swift

ios,uitableview,swift,segue
I've spent ages trying to solve this but with no resolve. I've finally got to a point where I am pulling my data from one one controller and moving it to the destination controller when I unwind segue, however, when the variable is only reloading in the println but not...

iOS programmatically triggered segue is performed multiple times on success

ios,objective-c,iphone,segue,nsnotificationcenter
I connect my app to a rest API to log in the user. When the log in procedure is finished, I use the NSNotificationCenter to inform the controller of the successful log in and for the app to perform the segue to take the user ot the main menu. Here's...

Add Delay to PresentViewController

objective-c,xcode,uiviewcontroller,segue,viewcontroller
I was wondering how to add a 1.0 second delay to this segue I have in my code: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *homeViewController = (UIViewController *)[storyboard instantiateViewControllerWithIdentifier:@"HomeViewController"]; [self presentViewController:homeViewController animated:YES completion:nil]; I know you can do this: [self performSelector:@selector(showModalTwo:)withObject:someNumber afterDelay:1.0f]; I just dont have this or want...

Swift Segue not working

ios,swift,segue
I have a school project to make a swift app. I'm very new to swift and trying to pass data through the segue from a tableview to another view. Here is the project file Download Here. override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "PopularDetails" { let detailsViewController...

How to segue from UIAlert and pass information

ios,swift,segue
I am pretty new to Swift and programming in general. I am making a quiz app and I want to transfer information between my quiz view controller and a new view controller. I have managed to successfully do that but now I want to use a UIAlertView to segue the...

prepareForSegue crashes when segueing in Core Data app

ios,objective-c,core-data,segue
I have a tableViewController set up to display data regarding objects in a managedObjectContext. I get no errors from the compiler, the program works fine until I click a UIButton in a cell to segue. I'm trying to pick out latitude and longitude values associated with an object in the...

I am unable to add identifiers to segues. Is there a way to repair a ios xamarin storyboard?

ios,xamarin,monotouch,storyboard,segue
I have been working with Xamarin since August and it has worked fine until recently. Our storyboards do not allow us to name newly created segues. I am only able to see some of the previously named segues in properties window. However if i open the storyboard using xcode it...

Swift Storyboard Segue Loads Blank View When Called From Closure

osx,swift,storyboard,closures,segue
If I call the segue from the View Controller's viewWillAppear(), the second view loads as expected performSegueWithIdentifier("CompleteSegue", sender: self) But if I perform an async download, and call the segue from inside the success closure, it calls the Segue, runs all the code, and displays the view, but it's completely...

Moving between UIViewControllers without Segue

ios,objective-c,uiviewcontroller,segue
I have a storyboard that has 8 UIViewControllers on it (and counting). I need to be able to move between any pair of these on demand. Essentially, what I am trying to do is to mimic the functionality of a UITabBarController. Since there are so many of these, I can't...

UISearchBar segue in CoreData using didSelectRowAtIndexPath

ios,core-data,uisearchbar,segue,didselectrowatindexpath
I have a Core Data project set up as a Master-Detail VC. I've added a UISearchBar to it which works properly. What's monopolized an amount of time I'm embarrassed to admit (it's BAD) is getting it to properly show the details when I click on the cell. I had been...

Calling prepareforSegue from a UIButton?

ios,swift,uitableview,uibutton,segue
I am trying to call a prepareForSegue function out of TableViewController from a button in an UITableViewCell. Can I just call it from the button? Something like: TableViewcontroller: func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) { if (segue.identifier == "segueExercise") { print(segue.identifier) let vc = segue.destinationViewController as! DetailViewController TableViewCell: @IBAction func exerciseAction(sender:...

TableViewCell title and subtitle to detail view controller (segue help)

ios,objective-c,uitableview,segue,detailview
i got a problem with my tableview segue and the detail view controller. i managed to populate my table view with titles and subtitles with nsdictionary. however i could not push my title and subtitle to the detail view. i need my title to go on the navigation bar and...

prepareForSegue passes value for Index 0…ALWAYS

ios,objective-c,uitableview,segue
I have an array of items displayed in a TableViewController. They display properly in the TVC. The code below segues, but it only segues to indexPath 0 of my array of MKMapItems, not the item from the cell that was clicked. Any thoughts on where my mistake is? @property (strong,...

How to make a segue from SpriteKit GameScene to UIViewController programmatically in iOS 9 with Swift2

sprite-kit,segue,identifier,swift2,ios9
I need to make a segue from a GameScene to a UIViewController but i keep getting Use of unresolved identifier "push" although I did give it that identifier In the GameSceneViewController I added scene.viewController = self and in my GameScene I added var viewController: UIViewController? and func segue(){ self.viewController.performSegueWithIdentifier(push, sender:...

UIStoryboardSegue: view is not displayed during animation

ios,xcode,swift,segue,unwind-segue
When my custom segue's animation is being performed, destination view appears black. After animation ends, view appears and looks good. Here are the screenshots: Animation scene: View after segue/animation finished: Here is the custom segue class: class SegueToPreview: UIStoryboardSegue { override func perform() { // Assign the source and destination...

Why does my UITableView not perform show segue, only presents modally

ios,uitableview,swift,segue
Hi all I've been having a issue with my app in that all segues from a UITableView only present with 'present modally' (up from the bottom) rather than show (reveal from the right) The relevant VC methods are func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 14 }...

Is it possible to use unwind segues in WatchKit?

storyboard,segue,watchkit
I'm looking to have a WKInterfaceController unwind to the previous after a button is pressed. This technical note from Apple is not updated for WatchKit.

Replace-root-view-controller custom segue with animation?

ios,objective-c,storyboard,segue,uistoryboardsegue
I've got a custom UIStoryboardSegue subclass which just replaces the root view controller with the destination VC. Works exactly as I want it to... however, I'd like to be able to add a transition animation, and I can't find any good examples of how to do that in the context...

Segue between UIViewControllers without Storyboard OR XIB

objective-c,xcode,uiviewcontroller,segue
I have a nifty project I downloaded from GitHub (here) and I am playing around with it. The project has no storyboard or xibs whatsoever, and only one viewController, which is defined with just a viewController.h file and a viewController.m file. Perhaps a noob question, but can I have viewController1.h/m...

How to change the value of a certain core data across VCs/ How to know the index of a created CoreData?

core-data,segue,viewcontroller
I start from a TableView to create and store user information. This is how I create a core data entity called "Trials" in CreateTrialViewController. And I can successfully fetch it in the tableViewController after I come back to it. let trial : Trials = NSEntityDescription.insertNewObjectForEntityForName("Trials", inManagedObjectContext: self.managedObjectContext!) as? Trials {...

segueForUnwindingToViewController causing “Warning: Attempt to present <…> on <…> which is already presenting <…>”

ios,swift,segue,uistoryboardsegue,unwind-segue
I am building an app and recently discovered a huge memory leak caused by traditional segues. Therefore I learned about unwind segue. Everything works just fine if I simply use: @IBAction func prepareForUnwindToMainFromFriends(segue: UIStoryboardSegue) { } Memory leak is solved and 'everything is awesome'. But this solution looks ugly on...

One UIAlertController function with multiple actions - is this possible?

ios,swift,segue,uialertcontroller
The following code is for a function I wrote to handle the 'Back' button and the 'Logout' button. When the user taps 'Cancel', he will stay on the current view, when he taps 'OK' he will be taken to either the previous view or the login screen, depending on which...

How use adaptive size classes to determine which segue to use?

ios,segue,size-classes
I've been trying to determine which segue to use (depending on the current device) using adaptive size classes rather than to use userInterfaceIdiom in code. I saw this mentioned here but don't understand how to do it.

how to access segue in 'didSelectRowAtIndexPath' - Swift/IOS

ios,uitableview,swift,segue
I know how to pass data using segues from prepareForSegue function, but the thing i have a TableViewCell from which there are two possible segues to two different ViewControllers (let's just say A, B as of now). It was suggested here that it is best to connect the segues to...

Swift ios viewDidLoad or viewDidAppear

ios,networking,segue,lifecycle
I am new to Swift and im not sure how I should go foward with this. I have a table view that I populate with data from an external API. Then if you press on one item/row in the tableview you will get directed to that items "detail" page. When...

Xcode with Swift: How can I pass object back and forth in wizard steps?

xcode,swift,segue
I am stuck on implementing a rather simple task. I have wizard with 3 steps in which you create an entity of course. The wizard consists of a navigation view followed by 3 regular view. In the contoller of the first step I create the course object and pass it...

Popover segue from NSCollectionViewItem

objective-c,osx,cocoa,segue,nscollectionviewitem
TL;WR What is the best way to popover-segue from a cloned view (NSCollectionViewItem)? Good afternoon, I'm trying to figure out how to segue from an itemPrototype, but it's not as straight-forward as I was hoping, and has tripped my up, somewhat. I've got an NSCollectionView, with a variable number of...

swift: delegate is nil after segue

delegates,protocols,segue,nil
I have a center ViewCentroller with a button to another ViewController. In the first file I also declare a protocol. This delegate works just fine in the first ViewCentroller, but after the segue has been performed, the delegate is nil. How can I solve this?

Segue won't execute Swift

ios,uicollectionview,segue
I have a segue running form a Collection View (wrapped in a view controller) in to a another view controller, how ever the function never gets called: func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { println(segue.identifier) println(sender) println("SEGUE SELECTED: \(segue.identifier)") if(segue.identifier == "segueToDetailView") { let cell = sender as CollectionViewCell; } }...

Pass data beetwen view controller [duplicate]

ios,objective-c,segue,viewcontroller
This question already has an answer here: Passing Data between View Controllers 29 answers I'm trying to passe an object (PFObject) from an view controller to another, -(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { RestauCardViewController *restauCard = [[RestauCardViewController alloc]init]; RestaurantAnnotation *restoAnnotation = (RestaurantAnnotation *)view.annotation; restauCard.restaurant = restoAnnotation.restaurant; [self...

Add segue to dynamically created cells

ios,uitableview,swift,uicollectionview,segue
I am dynamically creating 9 cells that will fit into a UICollectionView. When tapped, each button will load a different view controller. As the cells are generated by data from an array, so I do not have the ability to set a segue with an identifier in Interface Builder. I...

Load second app interface in a segue

ios,swift,segue,watchkit,apple-watch
Basically what I want to do is depicted in the image below: However this only loads the middle and third interface, the first is hidden both from swiping onto and in the circle indicators at the bottom. I'd like to be able to load the second interface and swipe left...

App crashes due to unrecognized selector sent to VC

ios,objective-c,exception,uinavigationcontroller,segue
My app crashing due to unrecognized selector sent with segue. I know it's a common question in stackoverflow. I tried all the solution but could not get through this. I think i'm missing something. My current project throws this exception, but a new project with this same code does not...

Audio from MPMoviePlayerController continues playing after segue to next view controller

swift,segue,mpmovieplayercontroller
After adding a video file, the audio from the video preview continues even after a segue to the next VC is pressed. Is there any way to stop the audio from playing after the segue is pressed? var objMoviePlayerController: MPMoviePlayerController = MPMoviePlayerController() var urlVideo: NSURL = NSURL() @IBOutlet weak var...

Receiver … has no segue with identifier error

ios,swift,segue
The code in question: func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { tableView.deselectRowAtIndexPath(indexPath, animated: true) var card: String if (tableView == self.searchDisplayController?.searchResultsTableView){ card = self.filtered[indexPath.row] } else{ card = self.array[indexPath.row] } let destinationVC = SearchViewController() destinationVC.searchString = card destinationVC.performSegueWithIdentifier("ResultSegue", sender: self) } I'm trying to pass a string to another view...

Swift iOS: Perform a Segue from an Instance in a ViewController to another ViewController

swift,button,uiviewcontroller,segue
First of all, I have to say that there is so much information on this platform, because of everyone, who is helping. Thank you very much. At the moment, I have reached a point, where I am not able to go further on my own. This is my problem: I...

Can't pass variable into prepareForSegue in Swift?

ios,swift,segue
I'm trying to pass selectedName to VC #2 (BrandTableViewController). If I println(selectedName) in viewDidDisappear I get the value, however, the value is nil when it's in prepareForSegue? Can anyone see why? import UIKit import CoreData class NameTableViewController: UITableViewController, UITableViewDelegate { //Changes [String] to [NSManagedObject] var people = [NSManagedObject]() @IBOutlet var...

ios swift: @IBAction handling to avoid segue

ios,swift,segue
I have 2 views, first to enter some data and second to fill in more details based on the data the user entered on the first view. Therfore I have a function like: @IBAction func addNewCardSet(sender: AnyObject) { ... let givenCardSetName = newCardSetName.text if givenCardSetName != "" { ... save...

segue.identifier = nil in second view

ios,swift,segue
I have IOS Swift program, using Storyboards with NavigationController. There are two Views, lets call them mainView, secondView. From the mainView I have BarButtonItem to go to secondView. When pressing that button, it triggers prepareForSegue function in the mainView with segue.identifier = "secondView" When I have opend e.g. the secondView,...

How to segue to a new UIViewController at the end of an array count

ios,arrays,swift,uibutton,segue
Let me first explain the concept. I ask the user 3 questions, which are stored in an NSArray. There is one UITextField which the user will use to write all 3 answers to the questions. What I would like to happen, when all three questions have shown from the array,...

Performwithsegue and programatically switching views - Objective-C

objective-c,segue,viewcontroller
I am having a problem, I want to change to another viewcontroller when a timer expires and this works with this code: - (IBAction)Akkoord:(id)sender { UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"Innameformulier"]; [self presentViewController:vc animated:YES completion:nil]; [self performseguewithidentifier:@"nextcontroller"] } But when I use this, my variables...

Passing data forward to destination VC (with framework) in Swift?

ios,xcode,swift,uiviewcontroller,segue
I'm writing an application that takes data from a QR code scanner. I am just implementing the basics, and have a second view controller that is triggered when a new QR code is detected. The following code is in a custom view controller from RSBarcodes and implemented using CocoaPods. It...

dismiss a modally presented view controller to a different underlying view controller

ios,uiviewcontroller,segue
I have a UIViewController that's embedded in a Navigation View Controller. I then modally present another view controller that shows a countdown. Once the countdown ends, the modal view controller should be dismissed and show a different underlying view controller from the original presenting UIViewController. Does anyone know how to...

Specify direction of “show” (push) segue

ios,objective-c,swift,segue
Is there a simple way to specify the direction (from left, right, top, or bottom) of a "show" segue (previously called a "push" segue)? The default "show" segue goes from left to right, but I would like it to go from bottom to top....

Possible to delay a segue?

ios,objective-c,storyboard,delay,segue
I have an app with many segues built in the storyboard and I would like to delay them to show a quick animation on the clicked button. Is it possible to delay a segue without using segueWithIdentifier ? Using segueWithIdentifier means to delete all segues in storyboard for recreating them...

click on UIImageView to change ViewController

ios,swift,parse.com,segue,uistoryboard
I have a custom image (profile picture) that I want to click and go to a profile view. I am registering the click, and I have the segue set up in storyboard, but when I click, nothing happens. The profile picture is part of a PFTableViewCell(using parse), which is part...

Segue must be modal with page navigation

storyboard,segue,watchkit,uistoryboardsegue,apple-watch
I'm developing an app for Apple Watch that there is a scene with a table. When I select a row it pushes another scene perfectly. However when I added another scene and created the relationship of next scene with the first one the rows stopped working.I had to change the...

iOS 7 - Maintain view controller instance in Storyboard segue

ios,navigation,storyboard,segue,custom-transition
I have an interactive custom view controller transition based on a storyboard segue (push). The target view controller takes some time to be loaded as it contains a table with a lot of data; moreover when I leave this vc and come back, I need the table to maintain its...

Added navigation bar but there is no back button?

ios,uitableview,swift,segue,uistoryboardsegue
I created a table view and from there let say a user pressed a cell it will go to the detailItemView , but the only problem right now is that whenever a user is in detailItemView there is no back button even thought I already embed a navigation Controller Here's...

How to both dismiss and deinit a (Game)ViewController using swift?

ios,xcode,swift,sprite-kit,segue
What I want to achieve: segue from gameVC to mainmenuVC and get rid of the gameVC When the app starts it first shows a main menu viewcontroller with a play button that segues to the gameviewcontroller. When the user taps on a menu button sprite the following function in the...

No back button on segue in Swift 2

ios,swift,segue,swift2,ios9
I just ported my project over to Swift 2, and everything is working great - except that even the most simple segues have no back button. Here is the prepare for segue function that I am using: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller...

programaticlly load viewController class

ios,swift,segue,uistoryboardsegue
I want to load show (segue to) specific ViewController class when a user click a button. I need to do it only in code without dragging and creating segues in the story board. Say i have root viewController: class ViewController: UIViewController { func startPlayer(sender: AnyObject) { // B.startView() // should...

prepareForSegue UICollectionView not working (swift)

ios,swift,xcode6,uicollectionview,segue
I’ve tried to push segue by using UICollectionView (show image form MasterView to DeatilView) but is not working. Xcode also doesn’t show any error message. What’s wrong with my code. I need some advice. override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showDetail" { if let indexPath =...

Segue item info from CollectionView to ViewController

ios,objective-c,uicollectionview,segue
Good afternoon, I'm trying to make a Segue when the user touches an item from my CollectionView, but it's not working. First, I get the entries of the user from a database (and they are the full URL of the images) and then I display it in the Collection View....

Segue not working on tableView

ios,action,segue
Okay, I got this strange situation. I have multiple tableViews in my project, but only on one tableView I can click on an item and perform an action (go to next segue). On the other tableViews I can click what I want but nothing happens. I removed the one that...

Objective-C prepareForSegue Issue

ios,objective-c,uitableview,segue
I am using the prepareForSegue with my UISplitViewController and I have a NSMutableDictionary populating the UITableView with sections. What I am trying to do is pass the value of the selected value in the selected section to the method in my detailViewController, this is what I got so far: -...

Hide a UIViewController (Screen) in swift

swift,uiviewcontroller,uitabbarcontroller,segue,xcode6.3
As you can see the screen flow as follows: After clicking on the 'button2' of 'screen A', app shows 'screen B' from same storyboard which has a tab bar. After clicking on the 'red tab' of 'screen B', app shows the 'green button'(right corner). After clicking on the 'green...

Pass data from one view controller to the next WITHOUT a segue in swift

iphone,swift,uiviewcontroller,ios8,segue
So I have an app that where you choose a button in the first screen it will bring you to another screen depending on which one you chose on the first one. Because I have these possible different layouts I can't just use a segue from one button to the...

UIViewController LifeCycle

swift,uiviewcontroller,segue
I just tried some stuff using View Controller delegates and learn about their functionalities. There is one thing I would like to try: I wrote a function to unwind programmatically a viewController by using the segues. The views are inside a navigationViewController. Additionally I set a instance var inside my...

Segue doesn't transfer array

arrays,swift,segue
I cannot seem to understand why the array answers is empty whenever I run test the program. When I use println(finalResultsSegue) in view controller 1, I can see the array of results, but when I pass it to answers in view controller 2 it goes to the next screen but...

Swift : Pass TableViewCell text to new ViewController's cell

ios,uitableview,swift,segue,tableviewcell
How to pass the same text from tableVC to the detail tableVC using an array populated in tableVC. It is working in tableVC but no data passed into the detailVC. They share one tableviewcell. class TableViewCell: UITableViewCell { @IBOutlet var img: UIImageView! @IBOutlet var title: UILabel! } tableVC class TableViewController:...

Why performSegueWithIdentifier creates always a new instance?

ios,storyboard,segue
I have 3 view controller: containerViewController, questionViewController, answerViewController. How can I swap question and answer, without to create a new instance from the view controllers? So if one is created, use that one. Usually I swap between them like this: containerViewController!.performSegueWithIdentifier("question", sender:self) but this always creates a new instance....

Custom Tableview to Segue to Different View Controller

xcode,uitableview,swift,segue
Is there a way i can tag each individual cell and have them performSegueWithIdentifier to different ViewController? Currently, the coding only let me got to one tableview (calc). If i can have each individual cell got to Casing Capacity VC, Open Hole Capacity VC, etc, that would be great. class...

How to segue from one viewcontroller to another

ios,swift,segue
I have a problem about the segue if signupError == nil { println("logged in") self.performSegueWithIdentifier("segue", sender: nil) } else { if let errorString = signupError!.userInfo?["error"] as? NSString { // Update - added as! String error = errorString as! String } else { error = "Please try again later." } self.displayAlert("Could...

What would cause my segue to infinitely loop?

ios,swift,segue
I've implemented a count-down timer that will automatically start my application if the user doesn't select any options. When the timer hits zero, I invalidate it and fire performSegueWithIdentifier, which segues me to my desired view. At that point all is fine... well, sort of. I do notice that my...

How to pass data between controllers? [duplicate]

ios,uitableview,swift,segue
This question already has an answer here: How do you share data between view controllers and other objects in Swift? 4 answers I want to pass image and other data between UITableViewController (It have custom UITableViewCell). Into the function prepareForSegue I made following, but it don't work. override func...

How to do a “show (e.g Push)” segue programatically without animation?

ios,objective-c,swift,storyboard,segue
How can I do a "show (e.g Push)" segue programatically without animation? None of the solutions I've found works the same way as the one in storyboard.

Pass data through unwind segue

ios,swift,data,segue
I have been looking all over for an answer for this...I do not know how to pass data through an unwind segue. I know I am supposed to use prepareForSegue but I am not sure what I am supposed to put in. I am trying to pass a variable (myLabel)...

I am trying to pass a string from one view controller to another view controller while unwinding using segues and I am not able to do so

ios,swift,segue,viewcontroller
It shows that the source view controler does not have the string variable so what should I do? This is the code in my source view controller @IBOutlet var textfield: UITextField! @IBOutlet var tofirstbutton: UIButton! @IBOutlet var tosecondbutton: UIButton! var s:String! override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier...

iOS Segue opening two view controllers (assuming two table cells clicked)

ios,uitableview,segue,viewcontroller
When I click a table cell in my application it opens two view controllers. Which it seems to assume that I have clicked two cells, since it opens the cell before and the one I have clicked. The first 3 cells are pretty much static, every other cell underneath the...

iOS [Obj-C] segue based on matching keys in different MySQL tables in same DB

ios,mysql,objective-c,xcode6,segue
CatViewController.m : categoryArray = [[NSMutableArray alloc] init]; for(int i = 0; i < jsonArray2.count; i++) { NSString * cID = [[jsonArray2 objectAtIndex:i] objectForKey:@"categoryID"]; NSString * cDesc = [[jsonArray2 objectAtIndex:i] objectForKey:@"categoryDesc"]; NSString * cName = [[jsonArray2 objectAtIndex:i] objectForKey:@"categoryName"]; [categoryArray addObject:[[Categories alloc]initWidthCategoryDesc:cDesc andcategoryName:cName andcategoryID:cID]]; } [self.tableView reloadData]; } - (void)tableView:(UITableView *)tableView...

Swift ios not sure on how to connect or use an embedded UIPageViewController

ios,swift,uiviewcontroller,segue,uipageviewcontroller
I decided to drop my UIImageView and instead use an UIPageViewController so that users can swipe between images on the same page. What I have now is a normal UIViewController, in that I added a containerView in which I have embedded a UIPageViewController. So the UIPageViewController acts as a childview...

Swift: Custom class array in table view - editing the values: accessory segue or other?

uitableview,swift,segue,accessoryview
I have a custom class Medication with variables name and directions. I have this in an array presenting itself in a tableview showing Medication.name and Medication.directions. I'd like the user to be able to click either on the row or on the accessory button (Detail?) to edit the value in...

Swift - UIStoryboardSegue pop up ViewController programatically

swift,popup,storyboard,segue
I have UIButton attached to navigationBar programatically: catButton.addTarget(self, action: "oc:", forControlEvents: .TouchUpInside) var catBarButton:UIBarButtonItem = UIBarButtonItem(customView: catButton) self.navigationItem.setRightBarButtonItem(catBarButton, animated: false) when function oc() is triggered I want to popover view controller let segue = UIStoryboardSegue(identifier: "oc", source: self, destination: MDComDBCatsTVC()) prepareForSegue(segue, sender: but) but this doesn't open MDComDBCatsTVC.. How to...

Why does my app react to taps outside a modal view?

ios,objective-c,segue
I have an app that has a couple of embedded collection views inside of view containers in the root view. It also uses a modal view segue to open a preference setting view. I'm surprised to see that my app reacts to taps outside of the modal view. My non-iOS-specific...

Pushing a navigation controller is not supported - since Xcode 6.2 update

ios,xcode,uitableview,swift,segue
Hope someone can help me here, I have used a segue to popover a tableView onto the main view with no problems up until now. After the Xcode 6.2 update I get 'Pushing a navigation controller is not supported', I am not setting it as a push, I am setting...

How to hide the back button from the status bar on the Apple Watch?

swift,segue,watchkit
I want to hide the back button from my Apple Watch app from the status bar. I used the programmable segue to navigate. But I want to to hide/disable the back button. Is it possible?...

ios swift: return to previous view controller

ios,swift,segue
from a dynamic tableView "CardSets" I do a segue to a static tableView "AddCardSet" to enter some data. After successfull save() method I want to send the user back to the initial tableView "CardSets". How can I do that? Do I have to set a segue onto the save button?...

Changing button label in the container view by clicking button in the main view

ios,swift,cocoa-touch,containers,segue
I'm new to IOS programming. In my app, I have a container view which is connected to a page view controller with three pages. It works well. When I push a button in the main view controller, I want to change the button labels in the container view. So, I...

prepareForSegue won't work with custom segue (swift)

ios,swift,segue
I've created a custom segue and it keeps giving the same error. It happened even when I've created a real simple UIStoryboardSegue Class. Overriding method with selector 'prepareForSegue:sender:' has incompatible type '(CustomOpenSegue, AnyObject?) -> ()' This is how I'm calling it override func prepareForSegue(segue: CustomOpenSegue, sender: AnyObject?) { segue.iconFrame =...

Check the Sender of a Segue

ios,segue
In -prepareForSegue:sender:, how do I check if the sender was the view controller in which the -prepareForSegue:sender: is written? In other words, how do I compare the sender argument to see what was passed when calling -performSegueWithIdentifier:sender: I tried: - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"identifier"]) if ([(MyViewControllerClass *)sender...

Displaying a Picker View selection in another ViewController in Swift

swift,segue,picker
I am fairly new to Swift and am trying to have the item I select in my picker view display on a label on another screen. I know that when I want pass data from one page to another I need to use the prepareForSegue function but I cant figure...

how to make a page accessible from every other page in my app and able to unwind to where the segue comes from

ios,objective-c,swift,segue,unwind-segue
I am trying to create an on-top structure where user can go to a general page G from any other pages with a special gesture and go back to the page where s/he comes from. Is there a way to do this while not implementing a segue and an unwind...

Multiple buttons that each segue to multiple ViewControllers

ios,swift,segue
I have one view controller that displays a label with a foreign word. It has 4 buttons, each with 3 random words and 1 word matching the foreign word. Upon clicking either of the buttons, it needs to transition into 1 of the 2 view controllers on the bottom. the...

How do I send data to destination view controller?

ios,objective-c,uiviewcontroller,segue
I have a segue and I want to set a custom property of the destination view controller, ClueDetailViewController. I can't tell what's wrong with this code, but it crashes during runtime with the error "unrecognized selector sent to instance 0x7fa802f9cb20" (the destination view controller). ClueDetailViewController.h (the destination): #import <UIKit/UIKit.h> @interface...

Swift - How to properly architect buttons in MVC?

ios,swift,uiview,uibutton,segue
I had wrote a block of code which made a UIButtons in a UIView with a segue action all in the ViewController file. The segue action allows the user to press on the a UIButton and pushes a new UIView with the title of that button on it. This worked...

segue from multiple bar button items

ios,swift,uiviewcontroller,segue,rightbarbuttonitem
I have a view controller with 1 leftBarButtonItem and 2 rightBarButton Items. I have implemented them using this code. @IBOutlet weak var menuButtonLeft:UIBarButtonItem! @IBOutlet weak var menuButtonRight: UIBarButtonItem! var search = UIBarButtonItem(image: UIImage(named: "search.png"), style: UIBarButtonItemStyle.Plain, target:self, action: "activateSearch") self.navigationItem.rightBarButtonItems = NSArray(objects: menuButtonRight,search) self.navigationItem.setRightBarButtonItems([menuButtonRight,search], animated: true) The...

Swift - Passing data along with segues

ios,swift,uiviewcontroller,delegates,segue
here's the problem: I'm trying to pass along some data from one ViewController to another InfoViewController. It looks like this: Running, the app, it looks like this: Beside this two view controllers, I have some other ones in this app and their Segues are working perfectly, but, when I tap...

Swift Use Segue Return Parameter

swift,segue
I Used "performSegueWithIdentifier()" from 'A-VIEW' to jump to the 'B-VIEW' Now, I want to return to A,B carry the parameter transfer to A B: protocol changeDelegate : NSObjectProtocol{ func returnCard(controller:UIViewController,labelText:NSString) } var delegate:changeDelegate? @IBAction func rrrr(sender: AnyObject) { self.dismissViewControllerAnimated(true, completion:{ println("start") self.delegate?.returnCard("1234") }) } A: class AViewController: UIViewController,changeDelegate{ .... func...

Segue using didSelectRowAtIndexPath

ios,swift,core-data,segue,didselectrowatindexpath
I have a Master-Detail VC setup for a Core Data project. If the searchBar is active, one set of results is displayed, if it's not active, the objects from the fetchedResultsController displays in the MasterVC. I had been trying to segue using prepareForSegue, but I my instructor suggested I use...

Call storyboard scene without creating a segue in swift?

ios,swift,uiviewcontroller,segue
I created a scene and tried to link the class to the scene and create a segue with the storyboard and use self.performSegueWithIdentifier("SegueID", sender: self) and no matter what I did (i.e. clean build) I still got the same error "reason: 'Receiver () has no segue with identifier 'SegueID''" I...

Which “init” method does segue call on UIViewController?

ios,object,segue
Bear with me here, when we link one UIViewController to another one with a segue, which "init" method does the segue use to initiate the new UIViewController? Is it "initWithCoder" ? or something else? I need to know because I need to modify the init method that segue uses to...

Unwanted UITableViewCellAccessory magically appears after segue (Swift)

ios,uitableview,swift,uisearchbar,segue
I have an app which shows which colleagues are inside the office and which aren't (based on awesome iBeacon stuff). However, the UITableView that displays them isn't working as expected. It's hard to explain so I added some pictures. Below is how the tableView normally looks. These are custom cells...

xcode 6 - swift - passing a string through popover segue

swift,webview,segue,popover
My project has two view controllers. The initial view controller has three buttons (viewController1). The second view controller has a webview (viewController2). I set up a present as popover segue from the viewController1 to viewController2. I would like each button to open a specific webpage in the webview when the...

indexPath variable not inheriting value

ios,swift,tableview,segue
I'm trying to perform a segue and pass the tapped 'audioNSURL' to my next viewController. The issue that I have is that, in my segue, 'indexPath' is null (not inheriting the tapped value from tableView). Can anyone point me in the right direction? // Function for when cell is tapped...

Why is my swift code pausing at the loading screen?

ios,swift,uiviewcontroller,segue
if timerRunning == false{ timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector("counting"), userInfo: nil, repeats: true) timerRunning = true } while timerLabel.text != "0"{ gameViewStillRunning = false } if gameViewStillRunning == false{ self.performSegueWithIdentifier("segue", sender: nil) } The purpose of this code is to display a label counting down, and then when...

performSegueWithIdentifier error

ios,swift,segue
Updated: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "addMapItem" { geocoder.geocodeAddressString(textAddress.text, completionHandler: {(placemarks: [AnyObject]!, error: NSError!) -> Void in if let placemark = placemarks?[0] as? MKPlacemark { var lat = placemark.coordinate.latitude var long = placemark.coordinate.longitude var coordinates = placemark.coordinate var annotation = MKPointAnnotation() annotation.coordinate = placemark.coordinate annotation.title...

Swift ViewController textFieldCancel:]: unrecognized selector sent to instance during segue [duplicate]

swift,cocoa-touch,ios8,segue
This question already has an answer here: “Unrecognized selector sent to instance” error 3 answers I've run into an annoying issue when trying to segue to a Pages View Controller from my initial UIViewController. My initial UIViewController, among other things, includes a UITextField. Everytime I attempt to segue out...

Trigger Segue Artificially

osx,swift,segue,viewcontroller
I am trying to pass data between two viewContollers in an OS X storyboard application using Swift. When I press a button on VC1, it opens VC2, and prepareForSegue is run. However, I can't pass data back to VC1 because a. prepareForSegue isn't being run (because a window isn't being...