segue

UISearchController persisting after segue

二次信任 提交于 2019-12-17 10:56:36
问题 I have an app with a UISearchController. This element of the UI is completely set up in code like this: searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self searchController.searchBar.delegate = self searchController.dimsBackgroundDuringPresentation = false searchController.hidesNavigationBarDuringPresentation = false searchController.searchBar.searchBarStyle = UISearchBarStyle.Minimal searchController.searchBar.frame = CGRectMake

How to execute some code after a segue is done?

a 夏天 提交于 2019-12-17 10:56:29
问题 Is it possible in iOS 6 to know when a UIStoryboardSegue has finished its transition? Like when i add a UIStoryboardSegue from UIButton to push another UIViewController on the navigationcontroler, i want to to something right after the push-transition is finished. 回答1: You can use the UINavigationControllerDelegate protocol and then define: – navigationController:didShowViewController:animated: 回答2: In case you don't want to use the viewDidAppear: method, you could create a custom segue. In

Swift: Pass UITableViewCell label to new ViewController

拈花ヽ惹草 提交于 2019-12-17 08:54:06
问题 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

Instead of push segue how to replace view controller (or remove from navigation stack)?

烂漫一生 提交于 2019-12-17 05:36:08
问题 I have a small iPhone app, which uses a navigation controller to display 3 views (here fullscreen): First it displays a list of social networks (Facebook, Google+, etc.): Then it displays an OAuth dialog asking for credentials: And (after that, in same UIWebView ) for permissions: Finally it displays the last view controller with user details (in the real app this will be the menu, where the multiplayer game can be started): This all works well, but I have a problem, when the user wants to go

IOS7, Segue and storyboards - How to create without a button?

喜夏-厌秋 提交于 2019-12-17 03:36:20
问题 I currently have a login View and an Application view, I have successfully implemented validation on the login view and I need to programmatically shift to the application view on successful validation. I understand I can add a segue to the login button and then call it programmatically like so... [self performSegueWithIdentifier:@"LoginSegue" sender:sender]; But this will obviously be triggered whenever the button is clicked (As the segue was created attached to the button). I've just read

IOS7, Segue and storyboards - How to create without a button?

懵懂的女人 提交于 2019-12-17 03:35:26
问题 I currently have a login View and an Application view, I have successfully implemented validation on the login view and I need to programmatically shift to the application view on successful validation. I understand I can add a segue to the login button and then call it programmatically like so... [self performSegueWithIdentifier:@"LoginSegue" sender:sender]; But this will obviously be triggered whenever the button is clicked (As the segue was created attached to the button). I've just read

How to make a push segue when a UITableViewCell is selected

落花浮王杯 提交于 2019-12-17 02:34:10
问题 I have a list of effects in a table view. I have created a top right bar button which does a push segue to another view controller which helps create a new effect. Now I want to add push segues to the table view cells so that the effects values maybe loaded on the add effects view controller and I can save the edited values. The question is can I create a push segue programmatically? If not can I pass the effect through a prepareforsegue ? If I try to use a prepareforsegue , I run into a

Passing data between View Controllers (Swift)

扶醉桌前 提交于 2019-12-14 03:57:40
问题 I'm trying to pass an Image from one view to another and my code doesn't seem to be working- it takes the user to the new view but the image isn't transferred over as well. Any help would be greatly appreciated! So, here's a button called Post that takes the user to a new view. @IBAction func postButton(sender: AnyObject) { performSegueWithIdentifier("toBrowsePage", sender: nil) } Then, in another file for the other view controller... override func prepareForSegue(segue: UIStoryboardSegue,

CellForRowAtIndexPath returning the wrong cell

北战南征 提交于 2019-12-13 21:41:14
问题 I am running into an issue where cellForRowAtIndexPath is returning the wrong cell and therefore, it is seguing and performing other actions on the wrong cell. I have built custom cells that are quite big because I am fitting some UIImageViews (+text +buttons), so a cell takes up the entire screen. When you scroll down and two cells are on the screen at the same time, if you tap on the top one, it segues to the content of the bottom one (same for button actions inside the cell). I thought

How to perform segue inside unwind function

本秂侑毒 提交于 2019-12-13 19:13:52
问题 I have 3 MVCs and name them A, B, C here. A is the main MVC with a button "Menu" connected to B with popover segue. A also connected to C with a manual show segue. B is a popover MVC with a button "Detail" connected to A with unwind segue. C is the detail MVC with detail info. Inside the unwind function of A. I call performSegueWithIdentifier to show C. Expected behavior is Click "Detail" button in B B disappear and A show up C show up But running the app I got. Click "Detail" button in B B