introduce

Scan to identify names and ID numbers, perfect support for bitcode. Depending on OpenCV, the library is quite large and pod install will take a while 😜

use

  • PodfileIn thepod 'SSIDCard'
  • info.plistAdd to filePrivacy - Camera Usage DescriptionDescription, or crash
  • Import header file<SSIDCard/SSIDCard.h>
  • There are two ways to call:
    • block:
    OC: SSScanViewController *scanVC = [[SSScanViewController alloc] initWithBlock:^(SSIDCard *idcard) { self.nameLbale.text = [NSString stringWithFormat:@" name: %@", idcard.idName]; self.numberLabel.text = [NSString stringWithFormat:@" iD number: %@", idcard.idNumber]; }]; [self presentViewController:scanVC animated:YES completion:nil];Copy the code
    Swift: let vc = SSScanViewController.init { (idcard) in print(idcard.idName ?? "") } self.present(vc! , animated: true, completion: nil)Copy the code
    • delegate
    SSScanViewController *scanVC = [[SSScanViewController alloc] init]; scanVC.delegate = self; Implement proxy methods: - (void)ss_scanViewController:(SSScanViewController *)scanViewController didObtainedRecognizeResult:(SSIDCard *)idcardCopy the code

License

SSIDCard is available under the MIT license. See the LICENSE file for more info.