Giter VIP home page Giter VIP logo

pzxforxcode / pzxcodetextfield Goto Github PK

View Code? Open in Web Editor NEW
211.0 3.0 7.0 4.59 MB

Support Swift & OC A segmented verification code or password input control, you can customize the size and input bits and select the border color. /一个按格分割的验证码或者密码输入控件,可以自定义大小和输入位数以及选中边框颜色等。

License: MIT License

Objective-C 75.76% Swift 24.24%

pzxcodetextfield's Introduction

PZXCodeTextField

PZXCodeTextField Logo

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

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 / 手动


  1. Download and drop /Sources folder in your project.
  2. 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

    }

pzxcodetextfield's People

Contributors

pzxforxcode avatar pzxqdm avatar

Stargazers

qm avatar  avatar  avatar  avatar Jake Smith avatar JJ avatar  avatar LucianaiB avatar  avatar Yao Yao avatar lDevin avatar  avatar  avatar HelloWorld avatar Nice avatar HuYihan avatar Zach_Zhang avatar &nbsp; avatar 自由的世界人 avatar  avatar Mr.L avatar  avatar MuaCherish avatar wozuidiao avatar  avatar 追风 avatar Jack Tony avatar Baoea avatar happyDev avatar  avatar john river avatar  avatar JingMin Yang avatar 程晓强 avatar  avatar 小豆美美 avatar  avatar Chen Zhao avatar codeflying0817 avatar 锌小子 avatar dlimeng avatar McAloma avatar  avatar  avatar LinYi avatar  avatar Tigger avatar KeienWang avatar Lazy_Frog avatar  avatar AhmedRabby avatar  avatar  avatar Tailor3D avatar Hai avatar liu4166 avatar Sun Weixiang avatar TellMeWhy1122 avatar Anylife178600 avatar andy3265898 avatar Ash avatar Kevins avatar 厦门飞骥科技有限公司 avatar Andy.Yan avatar  avatar Dyang avatar 爱可可-爱生活 avatar  avatar Lex avatar Jiaqi Li avatar ShowMaker avatar chiefass avatar 李子凡 avatar  avatar  avatar MahoneLau avatar  avatar sada avatar  avatar  avatar  avatar wjp avatar  avatar 陈震 avatar HugoWw avatar  avatar zhanghao5683934 avatar  avatar  avatar Lujia Jin avatar  avatar  avatar Tsung-Wei Huang avatar  avatar  avatar Wind avatar ViporMinerProxy avatar  avatar Ma Shiqing avatar LedArx avatar

Watchers

James Cloos avatar  avatar  avatar

pzxcodetextfield's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.