ios - UIImagePicker - Do not allow panorama to be picked -
looking image picker. picker functioning - - allows user pick panorama photos normal photos on device.
i want have picker allow user choose non panorama pictures.
i looked through dev document , couldn't find this. appreciated! here's code:
@ibaction func selectimage(sender: anyobject) { let imagepicker = uiimagepickercontroller() imagepicker.delegate = self imagepicker.sourcetype = uiimagepickercontrollersourcetype.photolibrary imagepicker.mediatypes = [kuttypeimage nsstring] imagepicker.allowsediting = false self.clearbtn.hidden = false self.presentviewcontroller(imagepicker, animated: true, completion: nil) } func imagepickercontroller(picker: uiimagepickercontroller, didfinishpickingmediawithinfo info: [nsobject : anyobject]) { self.dismissviewcontrolleranimated(true, completion: nil) let image = info[uiimagepickercontrolleroriginalimage] as! uiimage self.postimage.contentmode = .scaleaspectfit self.postimage.image = image self.haspicture = true }
i know changing uiimagepickercontrollersourcetype .photolibrary allow picking camera roll, hoping still allow shared photo streams , such weren't panoramic.
as christian posted in comment - there no native way uiimagepicker allow types of pictures (excluding panorama).
you have handle validating image after returned.
Comments
Post a Comment