githubDEMO地址: https://github.com/PZXforXcode/PZXVerificationCodeTextField
用法
_pzxView = [[PZXVerificationCodeView alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 60)]; _pzxView.selectedColor = [UIColor blackColor]; // _pzxView.deselectColor = [UIColor cyanColor]; _pzxView.VerificationCodeNum = 4; // _pzxView.isSecure = YES; _pzxView.Spacing = 0;//每个格子间距属性 [self.view addSubview:_pzxView];
思路
通过for循环初始化多个textfield,然后通过代理处理textfleld的切换