【发布时间】:2018-05-17 01:42:26
【问题描述】:
当我之前添加的所有节点(例如)文本在打开照片库或相机以添加新照片节点后消失时,我遇到了一个问题。有什么办法可以解决吗? 我的警报代码:
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
alert.addAction(UIAlertAction(title: "Add Text", style: .default , handler:{ (UIAlertAction) in
self.addTextView.isHidden = false
self.inputTextField.becomeFirstResponder()
}))
alert.addAction(UIAlertAction(title: "Choose from Library", style: .default , handler:{ (UIAlertAction) in
alert.dismiss(animated: true, completion: nil)
let picker = UIImagePickerController ()
picker.delegate = self
picker.allowsEditing = true
picker.sourceType = UIImagePickerControllerSourceType.photoLibrary
self.present (picker, animated: true , completion: nil)
}))
alert.addAction(UIAlertAction(title: "Take a Photo", style: .default , handler:{ (UIAlertAction) in
alert.dismiss(animated: true, completion: nil)
let picker = UIImagePickerController ()
picker.delegate = self
picker.allowsEditing = true
picker.sourceType = UIImagePickerControllerSourceType.camera
self.present (picker, animated: true , completion: nil)
}))
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler:{ (UIAlertAction) in
// ACTION
}))
self.present(alert, animated: true, completion: nil)
【问题讨论】: