iOS - How to check if a modal view is present

后端 未结 4 979
傲寒
傲寒 2021-01-30 05:13

Is there a way to check if a modal view is present? I\'d like to run a method only if a modal view is present. Also, if I have multiple modal views, is there a way to check if a

4条回答
  •  不知归路
    2021-01-30 05:39

    You can check using: self.presentedViewController, which returns The view controller that is presented by this view controller, or one of its ancestors in the view controller hierarchy.

提交回复
热议问题