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
Podfile
In thepod 'SSIDCard'
info.plist
Add to filePrivacy - Camera Usage Description
Description, 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 codeSwift: 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 *)idcard
Copy the code
License
SSIDCard is available under the MIT license. See the LICENSE file for more info.