The bottom pop-up box of presentViewController adapts to ipad

        //Adapt to ipad

        if ([alert respondsToSelector:@selector(popoverPresentationController)]) {

            

            alert.popoverPresentationController.sourceView = self.view;

        

            alert.popoverPresentationController.sourceRect = CGRectMake(0, kScreenHeight, kScreenWidth, kScreenHeight);

        }

        

        [self presentViewController:alert animated:YES completion:nil];

        

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325312455&siteId=291194637