modalviewcontroller

Call Function in Underlying ViewController as Modal View Controller is Dismissed

萝らか妹 提交于 2019-11-27 13:14:35
问题 I have a mainViewController. I call [self pushModalViewController:someViewController] which makes someViewController the active view. Now I want to call a function in mainViewController as someViewController disappears with [self dismissModalViewController]. viewDidAppear does not get called probably because the view was already there, just beneath the modal view. How does one go about calling a function in the mainViewController once the modalView dismisses itself? Thanks a lot! 回答1: This

Auto layout invalid after presenting view controller (and many situation) [duplicate]

戏子无情 提交于 2019-11-27 11:08:48
问题 This question already has an answer here: View unusable after dismissViewControllerAnimated:completion: 4 answers Background: I have a custom container controller, which just like UITabBarController, but with switch animation. And I use auto layout to achieve. Because switch between child controllers is dynamic, the proper constraints are added to child view controller when its's view is added into container's view, not pre-setup in IB. (The constraints are added to the superview of course)

Swift Modal View Controller with transparent background [duplicate]

橙三吉。 提交于 2019-11-27 10:22:06
This question already has an answer here: Transparent background for modally presented viewcontroller 4 answers I know this topic is quite popular, but I'm a little iniciate problem in a programming language, the fact is that I still do not understand where I put the code. Well, I'll tell the whole case: I'm trying to make a modal Swift in a little different from normal: By clicking on a button, the ViewController is displayed (following modal type) on the screen, but with transparent background. Only the blue View with label will be displayed. When this ViewController is presented, it is with

Dismiss modal view form sheet controller on outside tap

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 07:25:58
I am presenting a modal view controller as a form sheet and dismissing it when the cancel button, which is a bar button item, is clicked. I need to dismiss it when I tap on outside of that view. Please help me with a reference. Note: my modal view controller is presented with a navigation controller. @cli_hlt, @Bill Brasky thanks for your answer. I need to dismiss it when tap occurs outside of the modal view which is a form sheet. I am pasting my code below. -(void)gridView:(AQGridView *)gridView didSelectItemAtIndex:(NSUInteger)index { if(adminMode) { CHEditEmployeeViewController *editVC = [

why “present modal view controller”?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 05:53:57
问题 Just curious about the modal view controller usage. When and why should we use them? Is there a guideline? I found the sample core data book code create a navigation controller just to present a modal view controller. Why is that? UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addViewController]; [self.navigationController presentModalViewController:navController animated:YES]; Is there a functional reason to this? Would it work if we just

iOS Present modal view controller on startup without flash

回眸只為那壹抹淺笑 提交于 2019-11-27 05:21:47
问题 I'd like to present modally, at first startup, a tutorial wizard to the user. Is there a way to present a modal UIViewController on application startup, without seeing, at least for a millisecond, the rootViewController behind it? Now I'm doing something like this (omitting first-launch checks for clarity): - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // ... UIStoryboard *storyboard = self.window.rootViewController.storyboard;

Presenting modal in iOS 13 fullscreen

懵懂的女人 提交于 2019-11-27 05:15:35
In iOS 13 Beta 1 there is a new behaviour for modal view controller when being presented. Now it's not fullscreen by default and when I try to slide down, the app just dismiss the View Controller automatically. How can I prevent this behaviour and get back to the old good fullscreen modal vc? Thanks pascalbros With iOS 13, as stated in the Platforms State of the Union during the WWDC 2019, Apple introduced a new default card presentation. In order to force the fullscreen you have to specify it explicitly with: let vc = UIViewController() vc.modalPresentationStyle = .fullScreen self.present(vc,

Implement custom animation to present modal view from specified view on iPad

巧了我就是萌 提交于 2019-11-27 05:03:19
问题 On the iPad we get much more room to work with, so presenting full screen modal views is not ideal. I know how to present modal views in the new formSheet and a close approach can be found on this question: iPad iTunes Animation The problem is that you cannot choose where the animation will come from, so it just defaults and appears from the center, I want to customize it so that it appears from a specific location. The best example I can find for this animation can be seen on the first few

UIViewController In-Call Status Bar Issue

六眼飞鱼酱① 提交于 2019-11-27 04:38:21
Issue: Modally presented view controller does not move back up after in-call status bar disappears, leaving 20px empty/transparent space at the top. Normal : No Issues In-Call : No Issues After In-Call Disappears: Leaves a 20px high empty/transparent space at top revealing orange view below. However the status bar is still present over the transparent area. Navigation Bar also leaves space for status bar, its' just 20px too low in placement. iOS 10 based Modally presented view controller Custom Modal Presentation Main View Controller behind is orange Not using Autolayout When rotated to

How to use a UISplitViewController as a Modal View Controller?

无人久伴 提交于 2019-11-27 03:31:32
问题 I am trying to display a UISplitViewController presenting it as a Modal View Controller in my iPad app. I manage to have it display, but for some reason there is a gap to the left of the modal view the size of a Status Bar which is also preserved when the orientation is changed. Does anybody know why this is happening? Or if this is even possible? Maybe I'm just digging myself a huge hole. 回答1: The stock UISplitViewController was designed for use as the root view controller only. Presenting