Latest 1.2
Homepage https://github.com/CheeryLau/MMCaptchaView
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit
Authors

License MIT 
CocoaPods 
CocoaPods 

MMCaptchaView

CocoaPods

  1. pod "MMCaptchaView";
  2. pod install / pod update;
  3. #import <MMCaptchaView.h>.

For example:

_captchaView = [[MMCaptchaView alloc] initWithFrame:CGRectMake((self.view.bounds.size.width-100)/2, 200, 150, 50)];
_captchaView.captchaFont = [UIFont systemFontOfSize:30];
[self.view addSubview:_captchaView];

读取图片中的验证码:

NSString *captcha = _captchaView.captcha;

提供一个不区分大小写的比较方式:

BOOL isMatch = [self.captchaTextField.text caseInsensitiveCompare:_captchaView.captcha] == NSOrderedSame;
if (isMatch) {
    NSLog(@"验证码输入正确!!");
} else {
    NSLog(@"验证码输入错误!!");
}

END

有问题可以联系我【QQ:1539901764 要备注来源哦】,如果这个工具对你有些帮助,请给我一个star、watch。O(∩_∩)O谢谢

Latest podspec

{
    "name": "MMCaptchaView",
    "version": "1.2",
    "summary": "A picture verification code used on iOS.",
    "homepage": "https://github.com/CheeryLau/MMCaptchaView",
    "license": "MIT",
    "authors": {
        "Cheery Lau": "[email protected]"
    },
    "source": {
        "git": "https://github.com/CheeryLau/MMCaptchaView.git",
        "tag": "1.2"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "MMCaptchaView/**/*.{h,m}",
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This