I'm trying to make an app that has multiple buttons to perform the same "take a picture" action. The only think that will different with each button is that where I want the picture to be displayed. I have six buttons and I want them to display six different pictures on the same VC. I put in the Storyboard VC to show what I am looking to do. Here is my code for my first button, but I am trying to make every button do the same thing without retyping this every IBAction. Thanks!
@IBAction func photoBtnPressedOne(_ sender: AnyObject) {
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera) {
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = UIImagePickerControllerSourceType.camera;
imagePicker.allowsEditing = false
self.present(imagePicker, animated: true, completion: nil)
}