I have a tableView with a cell. In this cell, I have an imageView and a button that closes it. The button has IBAction. When pressed, the button should call up the image. The IBAction code is in the sub-cell.
@IBAction func MyStatusImageButtonAction(sender: AnyObject) {
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
imagePicker.allowsEditing = false
self.presentViewController(imagePicker, animated: true, completion: nil)
I get an error due to this line.
self.presentViewController(imagePicker, animated: true, completion: nil)
The error says: "A value of type" myCell "does not have the name" presentViewController ".
Should I load the imagePicker into a viewController that places the cell and then pass it to the cell? Should I load imagePicker in a cell with a different code? Am I really doing all this wrong?
For clarity, my goal is for the user to load this TableViewController and be able to assign an image only to the image in this cell.
Thanks.
user5619350