图片库未打开。相机工作正常但图像来自照片库没有让他们显示空白屏幕。昨天工作正常,但今天不开放。请帮助任何帮助将被apprciated。我是Ios的新手
@IBAction func uploadImageClick (sender : UIButton){
let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .ActionSheet)
let deleteAction = UIAlertAction(title: "Choose From Gallery", style: .Default, handler: {
(alert: UIAlertAction!) -> Void in
self.picker.allowsEditing = true
self.picker.sourceType = .PhotoLibrary
self.presentViewController(self.picker, animated: true, completion: nil)
})
let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel, handler: {
(alert: UIAlertAction!) -> Void in
})
optionMenu.addAction(deleteAction)
optionMenu.addAction(cancelAction)
self.presentViewController(optionMenu, animated: true, completion: nil)
}
extension NewsViewController : UIImagePickerControllerDelegate,UINavigationControllerDelegate{
func imagePickerController(
picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [String : AnyObject]){
let chosenImage = info[UIImagePickerControllerOriginalImage] as! UIImage
dismissViewControllerAnimated(true, completion: nil)
}
}