Presenting modal in iOS 13 fullscreen

后端 未结 30 2068
囚心锁ツ
囚心锁ツ 2020-11-21 06:48

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 dis

30条回答
  •  死守一世寂寞
    2020-11-21 07:08


    One Liner:

    modalPresentationStyle is required to be set on the navigationController which is being presented.


    iOS 13 and below iOS version fullScreen with overCurrentContext and navigationController

    Tested Code

    let controller = UIViewController()
    let navigationController = UINavigationController(rootViewController: controller)
    navigationController.modalPresentationStyle = .overCurrentContext
    self.navigationController?.present(navigationController, animated: true, completion: nil)
    

    modalPresentationStyle require to set at navigationController.

提交回复
热议问题