In iOS 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? I face this problem while using appodeal framework.
Code to show videoad
if Appodeal.isReadyForShow(with: .nonSkippableVideo){
Appodeal.showAd(.nonSkippableVideo, rootViewController: self)
}
Related
iOS 16 introduced a new API for forcing orientation changes, which implies using the requestGeometryUpdate(_:errorHandler:).
It seems that it's not working as expected when using a full screen modal.
For example, let's say we have an app that locks the orientation in portrait mode except for a modally presented controller, a parent controller A and a modal controller B :
A is displayed
We put the device in landscape mode - A stays in portrait mode
B is opened modally fullscreen from A
B is displayed in landscape
B has a button to go back to portrait mode using the requestGeometryUpdate(_:errorHandler:)
B is dismissed through a button
A ends up in landscape
In the app delegate, we used supportedInterfaceOrientationsFor to force the app in portait mode except for the controller B.
We tried to call setNeedsUpdateOfSupportedInterfaceOrientations every time we call requestGeometryUpdate(_:errorHandler:).
We also tried to call it on the viewWillAppear from the controller A.
We finally tried to call requestGeometryUpdate(_:errorHandler:) from the controller A's viewWillAppear, without any luck as well.
Is this a bug in iOS 16 or are we missing something ?
It seems to be working as expected when displaying the modal over the current context, but it's not what we want in this case.
I can provide an example project if needed.
I have a Xamarin Forms app. The iOS app presents a modal view controller like so:
UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(viewController, true, null);
The current view goes into the background and the modal view is presented. When that modal view is dismissed, it goes away but the view that went in the background stays there. I'm not sure how to bring it back to the front and make it active.
FYI, the viewController in this case is a native iOS UIViewController inside a framework. When used inside a native iOS project in Xcode, the modal view dismisses properly and the old view returns to the foreground.
Any thoughts?
I have a context menu in my app that shows a photo preview above the actions, and tapping the preview presents that view controller full-screen. On iPhone, when you tap the preview there’s a lovely animation - it bounces into full screen. But on iPad, when you tap the preview the context menu dismisses and then the screen appears without any animation.
This is the (new*) default behavior on iPad. The idea being you can use your own presentation animation. To get the system "pop" style that's default on iPhone, set the preferredCommitStyle to .pop on the UIContextMenuInteractionCommitAnimating object.
*I think it changed in iOS 13.4. This change broke the Photos app as well. 😅
Since running the iOS 13 beta I am having issues with my app displaying the interstitial view controller being displayed modally, therefore allowing the user to swipe down to dismiss the ad before the timer counts down.
I understand that modal views are now the default for iOS 13 and I have amended my main view controller to display full screen, however when the ad displays, this is still displayed modally and not full screen.
I have so far tried declaring the view controller, and then requesting it be displayed in full screen, then presenting the ad using the views declaration:
let vc = UIViewController()
vc.modalPresentationStyle = .fullScreen
interstitial.present(fromRootViewController: vc)
if interstitial.isReady {
if #available(iOS 13, *) {
interstitial.present(fromRootViewController: self)
interstitialDidDismissScreen(interstitial)
} else {
interstitial.present(fromRootViewController: self)
interstitialDidDismissScreen(interstitial)
}
Expected result is that the view for the interstitial ad is displayed full screen so that a user cannot swipe down to dismiss the view before the time runs out.
This works fine in iOS 12.
In case anyone else comes across this post, it was a simple solution in my case.
It appears as though Google had updated their framework but I wasn’t using the latest version of it.
Therefore a simple ‘pod update’ in Terminal updated the dependencies which in turn solved the problem.
I am using CocoaPods to manage my frameworks, but I’m sure for those who aren’t can find the best way to update their own dependencies.
straight to the point: Our app has UITableView with UITableViewCell that has AVPlayerViewController inside (its view) + custom video controls. One of the controls is fullscreen mode. Note that everything works perfectly - loading video, reusing, even the fullscreen.
Fullscreen functionality is based on creating new UIWindow, setting its rootViewController to the videoplayer and making it keyAndVisible - basically showing fullscreen AVPlayerViewController from cell subview on tap
The issue comes when user locks his device - after unlocking, the fullscreen window "disappears" and app is frozen / stuck on previous screen (the list with video cell, text cells.. - the one that made the new UIWindow)
The UIWindow (video window) is there, but without content (no subviews, VCs..) on top of the main (app, tableview list..) UIWindow - refer to pictures.
This issue is not happening on Simulator - only real devices.
View hierarchy debug before locking the device and showing the video on fullscreen (with new UIWindow):
View hierarchy debug after unlocking the device and app freezing on previous UIWindow:
Is there any possible fix? Or a better way of presenting AVPlayerViewController from UITableViewCell (while playing and without stopping the video)?
Note: the bug happens even if we remove landscape / portrait orientation changing, the issue seems to be related to UIWindow
PS: sorry for hiding the names in the pictures - NDA...