iOS - How to check if a modal view is present

后端 未结 4 948
傲寒
傲寒 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:28

    You can check the presence of a modal view controller from the parent view controller

    if ( [[self presentingViewController] presentingViewController] ) {
    
    }
    

提交回复
热议问题