NMAC427 / SwiftOCR

Fast and simple OCR library written in Swift
Apache License 2.0
4.61k stars 481 forks source link

No Output String #172

Open junaidxabd opened 4 years ago

junaidxabd commented 4 years ago

I'm not getting any output string. My code is below

    @IBAction func takePhoto(_ sender: Any) {

        imagePicker =  UIImagePickerController()
        imagePicker.delegate = self
        imagePicker.sourceType = .camera

        present(imagePicker, animated: true, completion: nil)

    }

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
        imagePicker.dismiss(animated: true, completion: nil)
        imageView.image = info[.originalImage] as? UIImage
        myImage = (info[.originalImage] as? UIImage)!

    }

    @IBAction func btnTapped(_ sender: Any) {
        print("Btn tapped")

        swiftOCRInstance.recognize(myImage) { recognizedString in
           // print(self.myImage)
            print(recognizedString)
         //   self.outputLbl.text = recognizedString
        }

    }
dheeraj447 commented 4 years ago

Junaid how have you converted to swift 5. Can you help me out. I'm stuck

junaidxabd commented 4 years ago

I didn’t convert to swift 5

dheeraj447 commented 4 years ago

Which version of swift are you using?

dheeraj447 commented 4 years ago

It doesnt support for my 4.2