Swift: Multiple Inheritance from classes Error UIViewController and UIIMagePickerController

ios, swift, uiviewcontroller

Solution

You should have UIImagePickerControllerDelegate, not UIPickerViewController in your first line. The system thinks that you are trying to have your controller inherit from both UIViewController and UIImagePickerController which is not allowed.

Problem

I manually added two additional controllers (`UINavigationControllerDelegate` & `UIImagePickerController`) to a `UIViewController` and I am receiving an error after adding the `UIImagePickerController` that says, `Multiple inheritance from classes UIViewController and UIImagePickerController` I'm not sure how to interpret and fix that right now. As a result of this error, I'm also seeing one when I use the `image.delegate` method and set it equal to `self` `Type ViewController does not conform to protocol UIImagePickerControllerDelegate` Code: ``` class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerController { @IBAction func pickImage(sender: UIButton) { var image = UIImagePickerController() image.delegate = self image.sourceType = UIImagePickerControllerSourceType.PhotoLibrary image.allowsEditing = false self.presentViewController(image, animated: true, completion: nil) } ```

Original source