Skip to content

Black background when ViewController 'modalPresentationStyle' changes to FullScreen #361

@saeid-pm

Description

@saeid-pm

Report

Environment

  • Xcode version: 12.0
  • PopupDialog version: V 1.1.1
  • Minimum deployment target: 11
  • Language (Objective-C / Swift): Swift
  • In case of Swift - Version: 5

Dependency management

  • Dependency manager (e.g. CocoaPods): CocoaPods
  • Version: 1.9.1

What did you do?

 func showPopup() { let popup = PopupDialog(title: "title", message: "message", transitionStyle: .fadeIn, hideStatusBar: true) let buttonOne = DefaultButton(title: "close", action: nil) popup.addButtons([buttonOne]) present(popup, animated: true, completion: nil) } 

And laso adde:

 let ov = PopupDialogOverlayView.appearance() ov.blurEnabled = true ov.blurRadius = 30 ov.liveBlurEnabled = true ov.opacity = 0.7 ov.color = .black 

What happened?

This issue happens when following Func is added (for presenting modal in iOS 13 fullscreen)

 override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { viewControllerToPresent.modalPresentationStyle = .fullScreen super.present(viewControllerToPresent, animated: flag, completion: completion) } 

then show the PopupDialog with black background:

Simulator Screen Shot - iPhone 11 Pro Max - 2020-12-14 at 17 06 54

And if .fullScreen changes to .overFullScreen, the background Blur effect will disappear and just show Popup without any effect.

Also, I tested this issue with Example project in repo and got the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions