[ad_1]
I’ve a tableView and viewcontroller. I want so as to add a photograph with imagepicker(i already accomplished that) after which I want to put it aside with an outline as a brand new put up in my tableView.Are you able to advise what’s the easiest way to do this?
I’ve already discovered an data how one can add textual content as a brand new cell in tableView , however that isn’t i wish to have.
Right here is my code
@IBAction func photoButton(_ sender: UIButton){
let vc = UIImagePickerController()
vc.sourceType = .photoLibrary //PHPpicker
vc.delegate = self
vc.allowsEditing = true
current(vc,animated: true)
}
@IBAction func saveButtonPressed(_ sender: UIButton){
}
extension NewPostScreenController : UIImagePickerControllerDelegate , UINavigationControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo data: [UIImagePickerController.InfoKey : Any]) {
UIImagePickerController.InfoKey(rawValue: "")
if let picture = data[UIImagePickerController.InfoKey(rawValue: "UIImagePickerControllerEditedImage")] as? UIImage {
ChangeImage.picture = picture
}
picker.dismiss(animated: true, completion: nil)
}
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
picker.dismiss(animated: true, completion: nil)
}
}
What ought to i add to saveButtonPressed?
[ad_2]
