segue

How do I perform an auto-segue in Xcode 6 using Swift?

送分小仙女□ 提交于 2019-11-27 14:11:26
I wish to auto-segue from the main viewController to a second view controller after a set period of time after an app loads. How do I do this? Do I need to do it programmatically? If your UI is laid out in a Storyboard, you can set an NSTimer in viewDidLoad of your first ViewController and then call performSegueWIthIdentifier when the timer fires: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. let timer = Timer.scheduledTimer(interval: 8.0, target: self, selector: #selector

UISearchController persisting after segue

巧了我就是萌 提交于 2019-11-27 13:56:02
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(searchController.searchBar.frame.origin.x, searchController.searchBar.frame.origin.y, searchController

How to execute some code after a segue is done?

筅森魡賤 提交于 2019-11-27 13:55:18
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. New You can use the UINavigationControllerDelegate protocol and then define: – navigationController:didShowViewController:animated: In case you don't want to use the viewDidAppear: method, you could create a custom segue. In the perform method you would use an animation for the transition, and that can have a completion block. You

Unwind segue from navigation back button in Swift

末鹿安然 提交于 2019-11-27 13:46:47
问题 I have a settings screen, in that I have a table cell. By clicking on that I take to another screen where user can choose an option and I want it back in the previous view controller when back button is pressed. I can put a custom bar button item, but I want to return to the parent view controller using the back button in the navigation bar rather than with a custom button on the view. I don't seem to be able to override the navigation back button to point it down to my unwind segue action

Segues and clearing historical ViewControllers from memory

随声附和 提交于 2019-11-27 12:52:53
问题 I have an iPad app which has a lot of screens and a lot of segue options. At the moment, I am simply using performSegueWithIdentifier to initiate these segues, and my fear is that I'm taking up a lot of memory as the user performs more and more segues. I've seen that people recommend using the function popToRootViewControllerAnimated: if using a UINavigationController, but the problem is that I'm not using one. How can I stop the number of VC's proliferating? The way the app works, the user

Unwind segue with Navigation back button

て烟熏妆下的殇ゞ 提交于 2019-11-27 12:47:14
问题 I have watched the apple demo video on storyboard implementation with the unwind segues section and seen the demo using custom buttons on the main view. That works fine. I have also seen a good example of the same thing here which works also. http://www.techotopia.com/index.php/Using_Xcode_Storyboarding_%28iOS_6%29#Unwinding_Storyboard_Segues However, I wish to have a normal push segue passing from parent (with main form data) to child (with advanced settings options) and then return to the

Is it possible to perform a Popover Segue manually (from dynamic UITableView cell)?

大兔子大兔子 提交于 2019-11-27 12:02:41
问题 I need to perform a Popover segue when user touches a cell in a dynamic TableView. But when I try to do this with this code: - (void)tableView:(UITableView *)tableview didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self performSegueWithIdentifier:@"toThePopover" sender:[tableView cellForRowAtIndexPath]]; //... } than I get an error: Illegal Configuration Popover segue with no anchor Is there any way to do this (to perform a popover segue from dynamic TableView manually)? 回答1: I was faced

DestinationViewController Segue and UINavigationController swift

ε祈祈猫儿з 提交于 2019-11-27 11:48:38
So I have a prepareForSegue method like this: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "fromEventTableToAddEvent" { let addEventViewController: AddEventViewController = segue.destinationViewController as! AddEventViewController addEventViewController.newTagArray = newTagArray } } However, at runtime the app crashes and logs spit out this message: Could not cast value of type 'UINavigationController' The error comes because the addEventController is embedded in a navigation controller, however I'm not sure how I would set up the segue

Segue from one storyboard to a different storyboard?

拜拜、爱过 提交于 2019-11-27 11:33:33
问题 I have too many views on one storyboard which is causing it to run really slow. I have been told that a solution to this issue would be to split the one storyboard into multiple storyboards. Could anyone tell me how I can segue from a view on storyboard 1 to a view in storyboard 2 via a button? 回答1: With Xcode 7 you can pick Storyboard References and set the destination storyboard and controller 回答2: In Swift (iOS 8.1) this is pretty easy : var storyboard: UIStoryboard = UIStoryboard(name:

Reversal of Custom Segue with Storyboarding

冷暖自知 提交于 2019-11-27 10:37:17
问题 I have a custom segue animation that occurs when pushing a new view controller onto the stack. When popping the view controller that was presented with said custom segue, however, the default navigation controller animation happens (that is, the current view controller animates to the right while the parent view controller translates on-screen from the left edge). So my question is this: is there a way to write a custom pop segue animation which happens when popping a view controller off the