返回編輯的圖像,所以我有像這樣設置的選擇器控制器:始終從的UIImagePickerController
func displayImagePickerButtonTapped() {
let myPickerController = UIImagePickerController()
myPickerController.delegate = self
myPickerController.sourceType = UIImagePickerControllerSourceType.photoLibrary
myPickerController.allowsEditing = true
self.present(myPickerController, animated: true, completion: nil)
}
現在myPickerController.allowsEditing = true
允許編輯。但是,用戶仍然可以返回原始圖像而不是編輯圖像,因爲編輯不是必須的,而是在這種情況下的奢侈品。
我該如何讓用戶只選擇一個編輯過的圖像,它總是每次都被裁剪成正方形的形狀?
您無法強制用戶編輯圖像。至少不能用'UIImagePickerController'。 – rmaddy