扫描识别姓名和身份证号,完美支持bitcode
,姓名和身份证号都是自己训练的模型,因为中文字符庞大,只训练了简单的常用字符,所以姓名识别并不是很准确。
执行pod install 后运行dmeo报错,请增加下图红框中信息
Podfile
中pod 'SSIDCard'
info.plist
文件中增加Privacy - Camera Usage Description
描述- 导入头文件
<SSIDCard/SSIDCard.h>
- 两种调用方式:
- block:
OC: SSScanViewController *scanVC = [[SSScanViewController alloc] initWithBlock:^(SSIDCard *idcard) { self.nameLbale.text = [NSString stringWithFormat:@"姓名:%@", idcard.idName]; self.numberLabel.text = [NSString stringWithFormat:@"身份证号:%@", idcard.idNumber]; }]; [self presentViewController:scanVC animated:YES completion:nil];
Swift: let vc = SSScanViewController.init { (idcard) in print(idcard.idName ?? "") } self.present(vc!, animated: true, completion: nil)
- delegate
SSScanViewController *scanVC = [[SSScanViewController alloc] init]; scanVC.delegate = self; 实现代理方法:- (void)ss_scanViewController:(SSScanViewController *)scanViewController didObtainedRecognizeResult:(SSIDCard *)idcard
SSIDCard is available under the MIT license. See the LICENSE file for more info.