presentviewcontroller

iOS whose view is not in the window hierarchy

爷,独闯天下 提交于 2019-12-02 04:54:19
问题 While i am Moving From PassCode Controller to OTP ViewController, iam getting the following error in console: Warning: Attempt to present < OTPController: 0x1e56e0a0 > on < PassCodeController: 0x1ec3e000> whose view is not in the window hierarchy! This is the code I'm using to change between views: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; OTPViewController *lOTPViewController = [storyboard instantiateViewControllerWithIdentifier:@"OTPViewController"];

iOS whose view is not in the window hierarchy

只愿长相守 提交于 2019-12-02 03:43:24
While i am Moving From PassCode Controller to OTP ViewController, iam getting the following error in console: Warning: Attempt to present < OTPController: 0x1e56e0a0 > on < PassCodeController: 0x1ec3e000> whose view is not in the window hierarchy! This is the code I'm using to change between views: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; OTPViewController *lOTPViewController = [storyboard instantiateViewControllerWithIdentifier:@"OTPViewController"]; lOTPViewController.comingFromReg = true; [self presentViewController:lOTPViewController animated:YES

swift presentViewController programmatically finds nil in destinationVC VDL

有些话、适合烂在心里 提交于 2019-12-01 14:38:09
Trying to solidify my knowledge by understanding lines of code at a basic level. I've tweaked my app to use ViewController(VC)2 as initial VC instead of VC1. I'm practicing populating this VC2 entirely by code. When coding a UIButton to segue into VC1, my console outputs "fatal error: unexpectedly found nil while unwrapping an Optional value" (lldb). and thread 1 points to VC1 viewDidLoad (VDL) where I've set some properties VC1 override func viewDidLoad() { super.viewDidLoad() P1Chip.hidden = true; P2Chip.hidden = true; P3Chip.hidden = true; P4Chip.hidden = true; P5Chip.hidden = true; P6Chip

swift presentViewController programmatically finds nil in destinationVC VDL

空扰寡人 提交于 2019-12-01 12:03:43
问题 Trying to solidify my knowledge by understanding lines of code at a basic level. I've tweaked my app to use ViewController(VC)2 as initial VC instead of VC1. I'm practicing populating this VC2 entirely by code. When coding a UIButton to segue into VC1, my console outputs "fatal error: unexpectedly found nil while unwrapping an Optional value" (lldb). and thread 1 points to VC1 viewDidLoad (VDL) where I've set some properties VC1 override func viewDidLoad() { super.viewDidLoad() P1Chip.hidden

Issue with calling viewWillAppear of presenting view controller when presented one is dismissed

痴心易碎 提交于 2019-12-01 11:21:41
I currently have a base view controller say AVC which present another view controller say BVC over current context like this: let bvc: BVC = sb.instantiateViewControllerWithIdentifier("BVC") as! BVC bvc.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext self.presentViewController(bvc, animated: true, completion: nil) Then I am setting a value in BVC and on dismiss, am using the same value to perform a function in the viewWillAppear of AVC. However, I noticed that when presenting OverCurrentContext, on dismiss, the viewWillAppear does not called. How do I go about fixing this?

Instantiating Modal view controller freezes the app - Probable issue with Xcode 7

孤街浪徒 提交于 2019-12-01 06:29:42
I am presenting a view controller modally in iOS app. The issue is that there is no crash and the app freezes as soon as presentViewController:animated is called. The stats show the CPU usage to be 100% and the usage doesn't go down even after manually closing the app. UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; CustomModalViewController *vvc = [sb instantiateViewControllerWithIdentifier:@"CustomModalViewController"]; if(!vvc){ NSLog(@"ERROR!!! vvc is null"); } NSLog(@"instantiate modal view controller"); vvc.providesPresentationContextTransitionStyle = YES; vvc

Instantiating Modal view controller freezes the app - Probable issue with Xcode 7

三世轮回 提交于 2019-12-01 05:19:37
问题 I am presenting a view controller modally in iOS app. The issue is that there is no crash and the app freezes as soon as presentViewController:animated is called. The stats show the CPU usage to be 100% and the usage doesn't go down even after manually closing the app. UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; CustomModalViewController *vvc = [sb instantiateViewControllerWithIdentifier:@"CustomModalViewController"]; if(!vvc){ NSLog(@"ERROR!!! vvc is null"); }

“viewWillTransitionToSize:” not called in iOS 9 when the view controller is presented modally

删除回忆录丶 提交于 2019-11-30 17:12:12
I present a view controller from another one: - (void)showModalView { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; MySecViewController *mySecViewController = [storyboard instantiateViewControllerWithIdentifier:@"secController"]; mySecViewController.delegate = self; [self presentViewController:mySecViewController animated:YES completion:nil]; } Then in the presented UIViewController , the method viewWillTransitionToSize:withTransitionCoordinator: is called in iOS 8 but not in iOS 9 ... Thanks In your current view controller, if you override

KEEP keyboard ON when UIAlertcontroller is presented in Swift?

£可爱£侵袭症+ 提交于 2019-11-30 04:59:18
When the alert pops up the keyboard is dismissed. I have looked everywhere but did not find solutions to keep the keyboard visible. When alert is presented the textfield seems to resign first responder automatically as the alert is presented modally. How is it possible to keep the keyboard behind this alert which means the textfield still editing even if no interaction will be possible ? Sam This solution works for me: let rootViewController: UIViewController = UIApplication.sharedApplication().windows.lastObject.rootViewController!! rootViewController.presentViewController(alert, animated:

“viewWillTransitionToSize:” not called in iOS 9 when the view controller is presented modally

北战南征 提交于 2019-11-30 00:31:52
问题 I present a view controller from another one: - (void)showModalView { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; MySecViewController *mySecViewController = [storyboard instantiateViewControllerWithIdentifier:@"secController"]; mySecViewController.delegate = self; [self presentViewController:mySecViewController animated:YES completion:nil]; } Then in the presented UIViewController , the method viewWillTransitionToSize:withTransitionCoordinator: is called