segue

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

不问归期 提交于 2019-12-05 14:57:09
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? infinite-loop This is how you do it: WKInterfaceController.reloadRootControllersWithNames( ["myInterfaceController"], contexts: [] ) Where myInterfaceController is the identifier of the destination Interface Controller. Thanks to Harvant for the pointer. If you check the docs for WKInterfaceController , you'll see there's no API to accomplish what you're looking for: https://developer.apple.com/library/prerelease

How can I auto segue when a timer finishes?

帅比萌擦擦* 提交于 2019-12-05 13:06:28
I want to auto segue when a timer runs out. I have a timer constructed here: class Timer{ var timer = NSTimer(); // the callback to be invoked everytime the timer 'ticks' var handler: (Int) -> (); //the total duration in seconds for which the timer should run to be set by the caller let duration: Int; //the amount of time in seconds elapsed so far var elapsedTime: Int = 0; var targetController = WaitingRoomController.self /** :param: an integer duration specifying the total time in seconds for which the timer should run repeatedly :param: handler is reference to a function that takes an

How can I dismiss a modal segue then perform push segue to new view controller

為{幸葍}努か 提交于 2019-12-05 10:18:46
I'm trying to perform a push segue from a navigation controller , after dismissing a modal that was previously presented over the navigation controller . Inside modal ( UIViewController ): func textFieldShouldReturn(textField: UITextField) -> Bool { var searchNav = SearchNavigationController() self.dismissViewControllerAnimated(true, completion: {searchNav.goToNextView()}) return true } Inside SearchNavigationController : func goToNextView() { performSegueWithIdentifier("searchNavigationToNextView", sender: self) } The issue is that when I hit return, I get this error: Terminating app due to

How do I add a segue to an UIGestureRecognizer

亡梦爱人 提交于 2019-12-05 09:25:42
I am building an app for the first time using Storyboards. I have a scene which I would like to have open another scene when there is a long tap on a particular button. I am able to add the UILongPressGestureRecognizer with no problem, but I can't figure out how to have that gesture be the segue to the other scene. Doesn't seem to matter what I Ctrl-Drag, nothing works. Am I missing something obvious? Thanks, Ken You can control-drag from your first controller's window to your second controller to create the segue, and then you can call performSegueWithIdentifier in your GestureRecognizer

Modal Segue Chain

北城余情 提交于 2019-12-05 08:50:50
I have an iOS app that has a log in view ( LognnViewController ) and once a user is successfully authenticated they are taken to another view ( DetailEntryViewController ) to enter some simple details. Once the details are entered the user is taken to the main part of the app that consists of a tab controller ( TabViewController ) that holds a variety of other views. The LogInViewController performs a modal segue to the DetailEntryViewController and the DetailEntryViewController then performs a modal segue to the TabViewController so I have kind of a modal segue chain going to get into the app

Using Segue Manually

夙愿已清 提交于 2019-12-05 07:40:46
I need to create two Segue's from the same button, and then I want to programatically choice which one to use based on device orientation. The problem I'm having is that you can only seem to create one segue from a button to another view so when I add the second one it just changes the first. How do you add a segue that either isn't linked to a button etc so I can do programatically or how are you supposed to do this. I want to have two views that get dynamically picked based on orientation rather than moving the objects based via code when rotated as there is alot of objects and custom stuff

No back button on segue in Swift 2

落爺英雄遲暮 提交于 2019-12-05 05:35:08
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 using [segue destinationViewController]. // Pass the selected object to the new view controller. if segue.identifier == "showExercise" { if let nav = segue.destinationViewController as? UINavigationController { if let exercisesController = nav.topViewController as? ExercisesController { let cell =

Making an asynchronous call prior to a segue to the next view controller (Swift)

白昼怎懂夜的黑 提交于 2019-12-05 05:01:02
I have a bunch of view controllers (embedded navigation controller), and I need to make some async calls before I segue to the next screen. The problem is that I need to make this call at the time I click the button mapped to the segue, but since the async call hasn't returned yet, the segue is made and the next view controller is shown. How do people do this kind of thing to prevent view controller navigation happening before the async call is returned? TL;DR You can create an @IBAction for the UIButton and inside the function make the async call and launch the segue manually in the

Xcode custom segue animation

纵然是瞬间 提交于 2019-12-05 05:00:53
问题 I have a problem with the transition animation between two storyboard controllers. I have a singleView project with two view controllers in the storyboard. Now I wand to make a custom transition animation: my current view controller should disappear to the left the new view controller should come from the right I have already a UIStoryboardSegue class. But what should I write in the -(void)perform{} method?? Thanks a lot, Jonas. 回答1: For that simple segue you can try something like this: -

Reference to the segue source view controller

跟風遠走 提交于 2019-12-05 04:04:45
Within my viewDidLoad I would like some custom code based upon the previous controller. How can I access the segue source controller or the previous segue identifier in the destination controller's viewDidLoad to handle this? There is no way to get a reference to the segue that created you. You could create a property (sourceVC in my example) in the destination controller, and assign self to this property in the prepareForSegue method (in the source view controller): [(DestinationVCClass *)segue.destinationViewController sourceVC] = self; You can just use [self presentingViewController] and