UIAlertView first deprecated IOS 9

后端 未结 10 1315
南笙
南笙 2020-11-28 02:29

I have tried several ways to use UIAlertController,instead of UIAlertView. I tried several ways but I cannot make the alert action work. Here is my code that works fine in I

10条回答
  •  佛祖请我去吃肉
    2020-11-28 03:09

    I tried the above methods, and no one can show the alert view, only when I put the presentViewController: method in a dispatch_async sentence:

    dispatch_async(dispatch_get_main_queue(), ^ { [self presentViewController:alert animated:YES completion:nil]; });

    Refer to Alternative to UIAlertView for iOS 9?.

提交回复
热议问题