0

I'm implementing the SwiftyCam pod in my iOS 10/ XCode8.2 app. It's a custom cameraviewcontroller pod, it seems really simple to use and implement, but when I run it it gives me this error. Can you guys help me? I already looked at other questions, using their lines of codes that worked for them, but nada, none of them worked for me.

Here's the code:

class randomController: SwiftyCamViewController, SwiftyCamViewControllerDelegate, UIImagePickerControllerDelegate,UINavigationControllerDelegate, CAPSPageMenuDelegate, AVCapturePhotoCaptureDelegate   {
    private var backgroundImage: UIImage

    init(image: UIImage) {
        self.backgroundImage = image
        super.init(nibName: nil, bundle: nil)
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.gray
        let backgroundImageView = UIImageView(frame: view.frame)
        backgroundImageView.image = backgroundImage
        view.addSubview(backgroundImageView)
        let cancelButton = UIButton(frame: CGRect(x: 10.0, y: 10.0, width: 30.0, height: 30.0))
        cancelButton.setImage(#imageLiteral(resourceName: "cancel"), for: UIControlState())
        cancelButton.addTarget(self, action: #selector(cancel), for: .touchUpInside)
        view.addSubview(cancelButton)
    }

    func cancel() {
        dismiss(animated: true, completion: nil)
    }
}
dan
  • 9,695
  • 1
  • 42
  • 40

0 Answers0