利用iOS绘制图片生成随机验证码示例代码

2020-01-18 17:41:55丽君

VIewController中调用


_codeView = [[CodeView alloc] initWithFrame:CGRectMake(15+(SCREEN_WIDTH-30)/3*2, 75, (SCREEN_WIDTH-30)/3, 39)];
 //手势
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick:)];
[_codeView addGestureRecognizer:tap];
[self.view addSubview: _codeView];

手势事件


- (void)tapClick:(UITapGestureRecognizer*)tap
{
  [_codeView changeCode];
}

总结

以上就是利用iOS绘制图片随机验证码的全部内容,希望本文的内容对各位iOS开发者们能有所帮助,如果有疑问大家可以留言交流。


注:相关教程知识阅读请移步到IOS开发频道。