WithiOS 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:
I add an information that could be useful for someone. If you have any storyboard segue, to go back to the old style, you need to set the kind property to Present Modally and the Presentation property to Full Screen.
I had this issue on the initial view right after the launch screen. The fix for me since I didn't have a segue or logic defined was to switch the presentation from automatic to fullscreen as shown here:
Using this way you don't need to do any change on any present call, as we are replacing the present method implementation in runtime.
If you need to know what is swizzling you can check this link: -objc-runtime/
Setting navigationController.modalPresentationStyle to .fullScreen has been repeated here more than a thousand times but let me present you another blocker which was causing that UIViewController / UINavigationController was not showing in fullscreen even though all the properties were set properly.
NOTE: If your view controller is contained in a navigation controller which is actually presented modally, then the navigation controller should approach the problem in the same way (meaning, having your custom navigation controller component customised in the same way
I'm making a small video app for an artist for gallery use. All is going well but I have a small problem with the fullscreen mode in swift (Ive tested when not in fullscreen mode and all functions well as expected.
This works well but then there is a preferences window which the user can open and which appears in front of the fullscreen video (this also works but only if I set the NSApplicationPresentationOptions as above - not in default fullscreen). The problem comes when the user closes the preferences window as a small gray window appears above the fullscreen video. See photo:
This is a more of an annoying problem as it requires more from the user when setting preferences than I would hope - the app will be used by gallerists and the collectors who by the work of the artist so it needs to be as user friendly as possible.
To be clear, the fullscreen works fine, the problem appears when I close another window (preferences for the app) which was in front of the fullscreen video. In this case I get an empty window which appears and needs to be quit by the user to see the film.
Also, its apparently that when I use this code to set the app to fullscreen it seems to create a bunch of other windows which dont exist without the fullscreen (I can see them all and select them from the misson control.
As mentioned this app is really simple - it should just have one window playing the film in fullscreen and then one preferences window which you can call from the menu bar. This all works as expected when the app is not in fullscreen but actually it has to be automatically in fullscreen all the time due to the nature of the project.
Whilst Im here - did you by any chance see the other question I posted regarding the video controls on yosemite ? I have a problem where on yosemite the play/pause button is missing in fullscreen mode - it seems all of my problems are with this fullscreen so Im thinking that I havent coded this part correctly. ps this is my first app in Swift so thanks for being patient with my novice questions!
...it seems to work how I would like without this problem of duplicate windows. I will send it to the artist now for him to test on a yosemite OS to see if I still have this problem with the controls as mentioned above.
Yes, window-based fullscreen is much easier to deal with than the older view-based kind. Since it's a normal window it plays nicely with your other windows and the Mission Control Spaces. View-style came out in 10.5; I did investigate it briefly but it was far too limited for my needs. I think it was primarily meant for simple kiosk-style apps, like touch-screen entry systems in a store, where the user isn't meant to ever interact with anything else on the Mac.
I always work with applications in fullscreen and two screens. I would like to be able to drag one application from one screen to the other when I have something open in fullscreen on the other screen. What actually happens is that I can't drag the application to the other screen that has something else open in fullscreen.
If you hold down the option/alt key while clicking the green button at the top left, that will cause the window to take up the full height of the screen. It will not cause it to horizontally fill the screen.
Each full screen application has to have it's own space. As you have noted, you can't drag one full screen app onto another. You can try going control - up arrow and create a new Desktop using the plus sign at the top right to see if that helps.
BetterTouchTool has a similar feature. You can drag a window to various sides of the monitor and it will snap to 1/4 of the screen, 1/2 of the screen, all of the screen, but not cover the menu bar nor the Dock.
The Fullscreen API has no interfaces of its own. Instead, it augments several other interfaces to add the methods, properties, and event handlers needed to provide fullscreen functionality. These are listed in the following sections.
Asks the user agent to place the specified element (and, by extension, its descendants) into fullscreen mode, removing all of the browser's UI elements as well as all other applications from the screen. Returns a Promise which is resolved once fullscreen mode has been activated.
The fullscreenElement property tells you the Element that's currently being displayed in fullscreen mode on the DOM (or shadow DOM). If this is null, the document (or shadow DOM) is not in fullscreen mode.
The fullscreenEnabled property tells you whether or not it is possible to engage fullscreen mode. This is false if fullscreen mode is not available for any reason (such as the "fullscreen" feature not being allowed, or fullscreen mode not being supported).
The availability of fullscreen mode can be controlled using a Permissions Policy. The fullscreen mode feature is identified by the string "fullscreen", with a default allowlist value of "self", meaning that fullscreen mode is permitted in top-level document contexts, as well as to nested browsing contexts loaded from the same origin as the top-most document.
Users can choose to exit fullscreen mode by pressing the ESC (or F11) key, rather than waiting for the site or app to programmatically do so. Make sure you provide, somewhere in your user interface, appropriate user interface elements that inform the user that this option is available to them.
This starts by looking at the value of the document's fullscreenElement attribute. In a real-world deployment, at this time, you'll want to check for prefixed versions of this (mozFullScreenElement, msFullscreenElement, or webkitFullscreenElement, for example). If the value is null, the document is currently in windowed mode, so we need to switch to fullscreen mode; otherwise, it's the element that's currently in fullscreen mode. Switching to fullscreen mode is done by calling Element.requestFullscreen() on the element.
The fullscreenEnabled property tells you whether or not it is possible to engage fullscreen mode. This is false if fullscreen mode is not available for any reason (such as the \"fullscreen\" feature not being allowed, or fullscreen mode not being supported).
The availability of fullscreen mode can be controlled using a Permissions Policy. The fullscreen mode feature is identified by the string \"fullscreen\", with a default allowlist value of \"self\", meaning that fullscreen mode is permitted in top-level document contexts, as well as to nested browsing contexts loaded from the same origin as the top-most document.
3a8082e126