segue

What's the difference between all the Selection Segues?

有些话、适合烂在心里 提交于 2019-11-27 09:55:44
Show Show Detail Present Modally Popover presentation Custom What is the difference between them? I couldn't find any documentation on it. There used to be some which I found in a Google search, but it's now gone: https://developer.apple.com/library/ios/recipes/xcode_help-interface_builder/articles-storyboard/StoryboardSegue.html Here is a quick summary of the segues and an example for each type. Show - Pushes the destination view controller onto the navigation stack, sliding overtop from right to left, providing a back button to return to the source - or if not embedded in a navigation

Swift pass data through navigation controller

為{幸葍}努か 提交于 2019-11-27 09:34:56
问题 One of my segues transitions from a view controller to a tableview controller. I want to pass an array between the two, but with a navigation controller before the tableview controller, I can't figure out how to pass the array. How do you pass data through a navigatiom controller to a tableview controller? 回答1: Override prepareForSegue and set whatever value on the tableview you'd like. You can grab the tableview from the UINavigation viewControllers property. override func prepareForSegue

Segue in SKScene to UIViewController

て烟熏妆下的殇ゞ 提交于 2019-11-27 08:09:33
In my GameScene.swift file, I am trying to perform a segue back to my Menu View Controller like so: func returnToMainMenu(){ var vc: UIViewController = UIViewController() vc = self.view!.window!.rootViewController! vc.performSegueWithIdentifier("menu", sender: vc) } This method is run when a node is tapped: override func touchesEnded(touches: NSSet, withEvent event: UIEvent) { for touch: AnyObject in touches { let location = touch.locationInNode(self) if gameOn == false{ if restartBack.containsPoint(location){ self.restartGame() } else if menuBack.containsPoint(location){ self.returnToMainMenu

performSegueWithIdentifier very slow when segue is modal

微笑、不失礼 提交于 2019-11-27 07:23:28
I have a simple table view where I handle the select action on the table view. This action follows a segue. If the segue is a push segue, the next view shows immediately. If the segue is a modal segue, the next view either: takes 6 seconds or so to display shows immediately if I tap again (second tap) I tried looking around for some ideas, but none seem applicable to my situation. In particular: I'm performing the segue on the main UI thread My view is very simple (so there's no issue in viewDidLoad ). Plus the fact that it shows up near instantaneous when the segue is push indicates that

Using shouldPerformSegueWithIdentifier( ) method in Swift

谁都会走 提交于 2019-11-27 07:05:26
问题 I am trying to use swift's shouldPerformSegueWithIdentifier() method, but it accepts 2 arguments. These are (identifier: String!, sender:AnyObject) My main goal is to execute the code when pressing a login button in my storyboard, and depending of a series of checks return TRUE or FALSE, depending if whether the correct username and password were provided. So here are my questions: What am I supposed to use as the identifier? Apple's documentation it explains that the identifier is a string

Swift: Pass UITableViewCell label to new ViewController

六月ゝ 毕业季﹏ 提交于 2019-11-27 07:00:39
I have a UITableView that populates Cells with data based on a JSON call. like so: var items = ["Loading..."] var indexValue = 0 // Here is SwiftyJSON code // for (index, item) in enumerate(json) { var indvItem = json[index]["Brand"]["Name"].stringValue self.items.insert(indvItem, atIndex: indexValue) indexValue++ } self.tableView.reloadData() How do I get the label of the cell when it is selected and then also pass that to another ViewController? I have managed to get: func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) { println("You selected cell #\

“Could not instantiate class named UIStoryboardShowSegueTemplate” - how can I make a Storyboard happy with iOS 7 and iOS 8?

痞子三分冷 提交于 2019-11-27 06:58:39
问题 I created a project in Xcode6, beta 6 or so (upgraded to b7 today). Using Swift, been developing for the iOS 8 SDK, etc. The Storyboard, so far, has two View Controllers, and a segue between the two set up as "Show" (it's not triggered by a button directly, it's handled by a successful login) Everything is groovy. And then I tried running the app on the iOS 7.1 simulator. It dies on the first screen with this message: *** Terminating app due to uncaught exception

How to find indexPath for tapped accessory button in tableView

末鹿安然 提交于 2019-11-27 06:38:54
问题 I've simple UITableView with one section and few rows. When user clicks cell accessory button (which is connected with detailsSegue . I want to know what cell row was it. So than I can select right object from my array and assign it to the variable from the next view. I have used delegate method tableview:accessoryButtonTappedForRowWithIndexPath: and assigned indexPath value to my private property myRow . Than in prepareForSegue:sender: method I used my self.myRow.row value to select right

Dark shadow on navigation bar during segue transition after upgrading to Xcode 5.1 and iOS 7.1

你说的曾经没有我的故事 提交于 2019-11-27 06:08:20
When I am navigating back & forth between parent and child controllers in a master - detail navigation controller, i see a dark shadow on the right side of navigation bar at top. It started after I upgraded to Xcode 5.1. It feels rough and distracting. How can I get rid of it? self.navigationController.view.backgroundColor = [UIColor whiteColor]; I solved this problem by setting the background color of the navigation controller's view. self.navigationController.navigationBar.translucent = NO; fixed it nonamelive's answer is perfect. To achieve the same thing in Interface Builder AND STILL KEEP

Segue from modal view to tab bar view controller and not lose tab bar

馋奶兔 提交于 2019-11-27 04:41:38
Hello Im trying to segue from a modal to a tab bar view controller without losing the tab bar? I know the question is short, but this is all I'm asking. Scenario: I have a Tab Bar View Controllers, A and B. B modals to C view controller. Then I want to return to View Controller A. Swift please :D Here is my example of how to do this. In my setup, I choose the yellow ViewController from the tab, then press Go! which modally presents the white ViewController . Pressing Exit returns to the green ViewController . To set this up, use an unwind segue to return to the viewController that called you.