Thursday, April 16, 2026
HomeiOS Developmentios - Learn how to save the photograph you uploaded with imagepicker...

ios – Learn how to save the photograph you uploaded with imagepicker as a brand new put up?

[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?

Right here is screenshot of my storyboard

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments