modalviewcontroller

Call Function in Underlying ViewController as Modal View Controller is Dismissed

半城伤御伤魂 提交于 2019-11-28 20:50:51
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! Grimless This answer was rewritten/expanded to explain the 3 most important approaches ( @galambalazs ) 1. Blocks

How to implement UIVisualEffectView in UITableView with adaptive segues

蹲街弑〆低调 提交于 2019-11-28 16:43:07
I would like to implement UIVisualEffectView to apply a blur effect to a view to show the view that lies behind it. This view that should have its background blurred is a UITableViewController that is embedded in a UINavigationController , and it will either be presented in a popover on iPad or it will be presented full screen modally on iPhone, thanks to iOS 8 adaptive segues (Present as Popover). When this view controller is in a popover I want the background to blur what's underneath the popover, and when it's presented full screen I want the background to blur the previous view controller.

presentViewController and displaying navigation bar

陌路散爱 提交于 2019-11-28 16:02:33
I have a view controller hierarchy and the top-most controller is displayed as a modal and would like to know how to display the navigation bar when using 'UIViewController:presentViewController:viewControllerToPresent:animated:completion' The docs for 'presentViewController:animated:completion:' note: 'On iPhone and iPod touch, the presented view is always full screen. On iPad, the presentation depends on the value in the modalPresentationStyle property.' For 'modalPresentationStyle', the docs say: The presentation style determines how a modally presented view controller is displayed onscreen

Modal View Controller Won't Start in Landscape Mode

∥☆過路亽.° 提交于 2019-11-28 11:27:26
I have a navigation based app that has a detail view (UIWebView) with action buttons across the bottom in a UIToolbar. I want to add 'notes' when the 'notes' button is pushed. Everything works fine when the webview is in portrait mode. I press the notes button, the modal view opens fine and works great. The problem occurs when the webview is in landscape mode. If I press the notes button, all the code to open the modal view gets called but all I get is a white screen. One comment: If I open the modal view in portrait and then rotate the device, it rotates fine into landscape mode. It just won

why “present modal view controller”?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 10:19:31
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 push the addViewController to self.navigationController? visakh7 Generally you use modal view

How to use a UISplitViewController as a Modal View Controller?

有些话、适合烂在心里 提交于 2019-11-28 10:17:54
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. The stock UISplitViewController was designed for use as the root view controller only. Presenting one modally goes against the Apple Human Interface Guidelines and has a high probability of getting rejected

Clear UIWebView content upon dismissal of modal view (iPhone OS 3.0)

笑着哭i 提交于 2019-11-28 05:54:34
I currently have a UIWebView that is displayed within a modal view. It is basically a detail view that provides a view of a page when the user clicks a link. When the view is dismissed and then brought up again (when the user clicks another link), the previously-loaded content is still visible and the new content loads "on top" of the last content. This makes sense because the instance of the UIWebView persists between sessions and is only released when the memory is needed. However, I would like to completely clear the UIWebView when the modal view is dismissed so that 1) content is cleared

How can I pop a modal view and the previous navigation controller view at once?

删除回忆录丶 提交于 2019-11-28 05:53:59
问题 I want to pop a modal view and the previous view at the same time. For example, look at the calendars app. When I am on the Edit screen and select Delete Event , I am taken back to the calendar view. The Edit screen, which was presented modally is popped as well as the the Event screen (where the user is just viewing the calendar event). The problem I am having is that I know how to pop a modal view, but from the same UIViewController subclass ( Edit screen in this example). How can I pop a

iOS Present modal view controller on startup without flash

扶醉桌前 提交于 2019-11-28 04:30:44
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; TutorialViewController* tutorialViewController = [storyboard instantiateViewControllerWithIdentifier:@

How to custom Modal View Controller presenting animation?

こ雲淡風輕ζ 提交于 2019-11-28 03:51:09
Instead of setting uiviewcontroller's modalTransitionStyle , I want to add an CAAnimation(or some other thing). This code can perform an custom animation in navigationController CATransition* transition = [CATransition animation]; transition.duration = 0.4; transition.type = kCATransitionFade; transition.subtype = kCATransitionFromBottom; [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; [self.navigationController pushViewController:adjustViewController animated:NO]; How can I implement it to a Modal View Controller? You just need to add the transition to the