Your application has presented a UIAlertController的解决方法
在相应的方法中添加
sourcePicker.popoverPresentationController?.sourceView = self.view;
sourcePicker.popoverPresentationController?.sourceRect = CGRect(x: self.view.bounds.size.width*0.5, y: self.view.bounds.size.height, width: 1.0, height: 1.0);
重点是sourceView和sourceRect这两个参数要在present()方法之前