Questions tagged [modalviewcontroller]

A modal view controller is a mechanism for managing a modal view, i.e. a view that assumes logical control of the user interface until the modal view is dismissed.

A modal view is a user-interface view that interrupts and existing workflow in order to present information to, and/or solicit information from, the end-user. A modal view generally assumes logical control over the user interface, and does not yield the user interface back to the presenting workflow until the user dismisses the modal view. Modal views generally represent some self-contained process or set of information that must be completed before dismissing the modal view and allowing the application's broader workflow to continue.

A "modal view controller" is a view controller that manages a modal view.


Apple-specific references:

  • Definition of a modal view.

  • View Controller Programming Guide has a broader discussion of view controllers.

  • Presenting Another View's Content in the UIViewController Class Reference enumerates the various methods for transitioning to a view controller modally, governing the particulars of the modal transition, and the process for dismissing a modally presented view controller.

1298 questions
638
votes
28 answers

Presenting modal in iOS 13 fullscreen

In iOS 13 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…
pascalbros
  • 16,122
  • 5
  • 23
  • 35
218
votes
7 answers

Disable the interactive dismissal of presented view controller

iOS 13 introduces a new design of modalPresentationStyle .pageSheet (and its sibling .formSheet) for modally presented view controllers… …and we can dismiss these sheets by sliding the presented view controller down (interactive dismissal).…
Jakub Truhlář
  • 20,070
  • 9
  • 74
  • 84
197
votes
24 answers

iOS: Modal ViewController with transparent background

I'm trying to present a view controller modally, with a transparent background. My goal is to let both the presenting and presented view controllers's view to be displayed at the same time. The problem is, when the presenting animation finishes, the…
109
votes
12 answers

presentViewController and displaying navigation bar

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…
104
votes
1 answer

Swift Modal View Controller with transparent background

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…
user5046034
92
votes
6 answers

iOS: Use a boolean in NSUserDefaults

When the rootViewController of my application is loaded, I want to be able to check whether or not the users login credentials have been saved to NSUserDefaults. Basically, when the user loads the application and he/she doesn't have her login…
83
votes
4 answers

dismissModalViewController AND pass data back

I have two view controllers, firstViewController and secondViewController. I am using this code to switch to my secondViewController (I am also passing a string to it): secondViewController *second = [[secondViewController alloc] initWithNibName:nil…
Andrew Davis
  • 2,310
  • 1
  • 24
  • 43
64
votes
2 answers

How can I detect the dismissal of a modal view controller in the parent view controller?

Possible Duplicate: Call Function in Underlying ViewController as Modal View Controller is Dismissed I've tried almost everything. Here's what I've…
objc-obsessive
  • 825
  • 1
  • 12
  • 18
56
votes
13 answers

iPad custom size of modal view controller

I have a couple of modal view controllers of certain size. I'm trying to avoid the use of custom views (creating full screen black translucent overlay over current view, add the modal view over that view, do the animations, etc) to present it…
emenegro
  • 6,901
  • 10
  • 45
  • 68
53
votes
10 answers

Delay in presenting a modal view controller

I have a tab bar based app. There are navigation controllers in all 5 tabs with instances of custom view controller setup properly as root view controllers. This loads just fine. A couple of these view controllers contain table views. I want to show…
Numan Tariq
  • 1,296
  • 1
  • 9
  • 18
37
votes
2 answers

How do I make an expand/contract transition between views on iOS?

I'm trying to make a transition animation in iOS where a view or view controller appears to expand to fill the whole screen, then contract back to its former position when done. I'm not sure what this type of transition is officially called, but…
Jesse Crossen
  • 6,945
  • 2
  • 31
  • 32
36
votes
9 answers

iOS Present modal view controller on startup without flash

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…
sonxurxo
  • 5,648
  • 2
  • 23
  • 33
34
votes
14 answers

Dismiss modal view form sheet controller on outside tap

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…
jessy
  • 491
  • 3
  • 7
  • 19
34
votes
5 answers

Handling In-Call Status Bar with Custom Modal Presentation

The Problem I've noticed some strange behavior when presenting a UINavigationController (with a root view controller, already pushed, naturally) with UIViewControllerAnimatedTransitioning during a phone call. If the in-call status bar is enabled…
Austin
  • 5,625
  • 1
  • 29
  • 43
33
votes
6 answers

Modal view controller won't dismiss itself

What I'm doing: In my app, I'm presenting a modal view controller (containing app settings) using the following code: optionsViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl; [self…
Jordan Smith
  • 10,310
  • 7
  • 68
  • 114
1
2 3
86 87