Setting delegate for UIImagePicker returns error

后端 未结 2 1421
情书的邮戳
情书的邮戳 2020-12-30 19:02

Having a problem in some swift code I had written for an OCR translation app. The code snippet is below:

@IBAction func btnOCR(sender: AnyObject) {

    var          


        
相关标签:
2条回答
  • 2020-12-30 20:04

    You must add UINavigationControllerDelegate to the class declaration.

    class ViewController: UIViewController, UITextFieldDelegate, UIPickerViewDelegate, UIPickerViewDataSource, UIImagePickerControllerDelegate, UINavigationControllerDelegate {    
    
    
     // Some thing here
    
    }
    
    0 讨论(0)
  • 2020-12-30 20:05

    You forgot about UINavigationControllerDelegate in your ViewController class defenition.

    The image picker’s delegate object.

    Declaration

    unowned(unsafe) var delegate: protocol<UIImagePickerControllerDelegate, UINavigationControllerDelegate>?
    
    0 讨论(0)
提交回复
热议问题