Present multiple modal view controllers?

前端 未结 6 982
温柔的废话
温柔的废话 2020-12-29 08:05

update:
I\'ve faced this problem again, and found another way. If presenting controller is not embedded in navigation controller, it will be hidden if p

6条回答
  •  粉色の甜心
    2020-12-29 08:38

    In some situations, you could have each modally presented view controller present the next one.

    let window = UIApplication.sharedApplication().keyWindow!
    if let modalVC = window.rootViewController?.presentedViewController {
        modalVC.presentViewController(vc, animated: true, completion: nil)
    } else {
        window.rootViewController!.presentViewController(vc, animated: true, completion: nil)
    }
    

提交回复
热议问题