当用户在拍照后点击用户照片选项时,有没有什么好办法再次显示相机?

时间:2017-02-28 10:45:21

标签: ios swift

用户在拍照后点按用户照片选项是否有再次显示相机的方法?在我目前的应用程序中,这就是我再次显示相机的方式,但在重新打开相机之前会延迟一段时间。

 func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {

    if let image = info[UIImagePickerControllerOriginalImage] as? UIImage {

        let dt = DateTime()
        let newImage = UIImage.init(cgImage: (image.cgImage)!,scale: 1.0, orientation: UIImageOrientation.up)
        let newImage1 = self.textToImages(drawText: dt as NSString, inImage: newImage, atPoint:CGPoint(x: (newImage.size.width/4),y: (newImage.size.height-50)))
        let Imagename = self.Create_imageName(index:self.index)
        let imageinfo = imageDescription(imageName: "\(Imagename).jpg", image: newImage1)
        self.imageArray.append(imageinfo)
        self.saveImages(img:newImage1,index:self.index,name:Imagename)
        self.index += 1
        DispatchQueue.main.async {
            self.imageCollectionView?.reloadData()
        }
        self.dismiss(animated: false, completion: nil)
        self.camera()
    }
}

0 个答案:

没有答案