Swift: 5.1.3
Xcode: 11.3.1
Привет, я работаю с приложением, использующим UIImagePickerController, и обнаружил, что мой код не работает, когда я запускаю его iPhone11 Pro Max Simulator.
Чем iPhone11 Pro Max Simulator отличается от других симуляторов?
Вот методы, связанные с UIIMagePickerController:
@IBAction func uploadImageTapped(_ sender: UIButton) {
let pickerView = UIImagePickerController()
// Set cameraroll sor chooseing a photo
// choose '.camera' if you want to take the picture
pickerView.delegate = self
pickerView.sourceType = .photoLibrary
self.present(pickerView, animated: true, completion: nil)
}
.
.
.
extension RetailerProfileViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
// method that will be called when user choose the pic
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
// get the info of photo
let image = info[.originalImage] as! UIImage
// show it
storeImage.image = image
// dismiss the photo library
self.dismiss(animated: true)
}
}