프로젝트
GitHub에서 보기
PZXforXcode/PZXCodeTextField
소개
Support Swift & OC A segmented verification code or password input control, you can customize the size and input bits and select the border color. /一个按格分割的验证码或者密码输入控件,可以自定义大小和输入位数以及选中边框颜色等。
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -3
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalPZXCodeTextField
intro / 简介
EN:
A segmented verification code or password input control that allows customization of size, input digits, and selected border color, among other options. Similar to the verification code input feature in the Uber app. If you have any questions or suggestions, feel free to add me on WeChat: KpengS.
Chinese:
一个按格分割的验证码或者密码输入控件,可以自定义大小和输入位数以及选中边框颜色等。类似uberAPP的验证码输入功能,有什么问题或者建议可以加我Vx:KpengS
支持OC和Swift使用
Overview / 概述
- Objective-C compatibility
- Swift 5 Support
- Supports CocoaPods
- Supports Custom Styling
- Supports Horizontal Line Input Style
- Quick Setup
- Continuous Updates
New Features / 新增效果
| 样式总览 |
|---|
| 格子输入框 | 动效 |
|---|---|
![]() |
| 横线输入框 | 动效 |
|---|---|
![]() |
| 下划线输入框 | 动效 |
|---|---|
Requirements / 支持
- iOS 12.0+
- Xcode 15+
Install / 安装
Manually / 手动
- Download and drop
/Sourcesfolder in your project. - Congratulations!
CocoaPods
pod 文件新增
To integrate PZXCodeTextField into your Xcode project using CocoaPods, specify it in your Podfile:
target '<Your Target Name>' do
pod 'PZXCodeTextField'
end
Usage: / 使用:
Objective-C
_cellView = [[PZXVerificationCodeView alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 60)];
_cellView.selectedColor = [UIColor blackColor];
// _pzxView.center = self.view.center;
// _pzxView.deselectColor = [UIColor cyanColor];
_cellView.VerificationCodeNum = 6;
// _pzxView.isSecure = YES;//密文
_cellView.Spacing = 0;//每个格子间距属性
[self.view addSubview:_cellView];
Swift
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let codeView = PZXVerificationCodeView.init(frame: CGRect(x: 0, y: 100, width: SCREEN_WIDTH, height: 60))
codeView.selectedColor = .black
codeView.verificationCodeNum = 4
codeView.spacing = 8
self.view.addSubview(codeView)
let codeInputView = PZXCodeInputView(numberOfFields: 4)
codeInputView.translatesAutoresizingMaskIntoConstraints = false
codeInputView.delegate = self
view.addSubview(codeInputView)
NSLayoutConstraint.activate([
codeInputView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
codeInputView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
codeInputView.heightAnchor.constraint(equalToConstant: 50),
codeInputView.widthAnchor.constraint(equalToConstant: 300)
])
}
func codeInputViewDidFinishInput(_ inputView: PZXCodeInputView, code: String) {
print("Code entered: \(code)")
// 在这里处理输入完成后的逻辑
// Handle the logic after input completion here
}
관련 프로젝트 살펴보기
불러오는 중…

