Latest 0.0.5
Homepage https://github.com/meilbn/MLBPasswordTextField
License MIT
Platforms ios 7.0, requires ARC
Frameworks CoreFoundation, CoreGraphics
Authors

License MIT
CocoaPods
Language
Platform
Support

A custom password input like WeChat payment for iOS.

中文介绍

Demo Project

See MLBPasswordTextFieldDemo/MLBPasswordTextFieldDemo.xcworkspace.

Usage

In Programmatically

MLBPasswordTextField * textField = [[MLBPasswordTextField alloc] initWithFrame:CGRectMake(0, 0, 240, 40)];

In Iterface Builder

Drag an UITextField to your Storyboard or XIB, set its class to MLBPasswordTextField.

That’s it!

If you want to custom, using properties in the Attributes Inspector.

Delegate

Delegate Implement delegate below to get called when input complete:

- (void)mlb_passwordTextField:(MLBPasswordTextField *)pwdTextField didFilledPassword:(NSString *)password;

Features

  • [x] Easy to use
  • [x] Use with Storyboards, XIBs, Code
  • [x] Design in Storyboard or XIB
  • [x] Cursor supported (>= 0.0.3)

Version History

  • 0.0.5 Add reset function to clear password.
  • 0.0.4 Fixed render view rect border has 1 pixel space when border width is 0.5 in iPhone 5S(i.e. 2x).
  • 0.0.3 Support show cursor.
  • 0.0.2 Bug fixes. Draw border and dot more precision.
  • 0.0.1 First version. Contains common features.

Installation

CocoaPods

  1. Add pod 'MLBPasswordTextField' to your Podfile.
  2. Run pod install or pod update.
  3. Import <MLBPasswordTextField/MLBPasswordTextField.h>.

Carthage

Not yet supported.

Manually

  1. Download all the files in the MLBPasswordTextField subdirectory.
  2. Add the source files to your Xcode project.
  3. Import MLBPasswordTextField.h.

Requirements

This library requires iOS 7.0+Xcode 8.0+.

Tested Devices

Devices

iPhone 7 Plus (iOS 10.1.1)

iPhone 5S (iOS 8.3)

iPhone 4S (iOS 8.1)

iPhone 4 (iOS 7.1.2)

Simulators

iPhone 6 (iOS 9.3)

iPhone 7 (iOS 10.1)

License

MLBPasswordTextField is provided under the MIT license. See LICENSE file for details.

中文介绍

一个 iOS 上自定义的密码输入文本框,类似于微信支付。

演示项目

运行 MLBPasswordTextFieldDemo/MLBPasswordTextFieldDemo.xcworkspace

使用方式

代码中使用

MLBPasswordTextField * textField = [[MLBPasswordTextField alloc] initWithFrame:CGRectMake(0, 0, 240, 40)];

Iterface Builder 中使用

拖拽一个 UITextField 到你的 Storyboard 或者 XIB 中,将其 Class 设置为 MLBPasswordTextField

就这样!

如果想自定义,可以使用 Attributes Inspector 中提供的属性。

Delegate

当输入完成时,可以使用 Delegate 的委托方法来获取回调:

- (void)mlb_passwordTextField:(MLBPasswordTextField *)pwdTextField didFilledPassword:(NSString *)password;

功能

  • [x] 使用简单
  • [x] 可以在 Storyboards、XIB 中使用,当然也可以通过代码创建
  • [x] 可以在 Storyboard 或者 XIB 中配置自定义属性
  • [x] 支持显示光标 (版本 >= 0.0.3)

版本历史

  • 0.0.5 增加了重置密码方法。
  • 0.0.4 修复了当 borderWidth 为 0.5(也就是默认宽度)时,在 iPhone 5S(也就是 2x) 上画的边框存在 1 像素空隙的 bug。
  • 0.0.3 支持显示光标。
  • 0.0.2 Bug 修复。更加精确地画边框和点。
  • 0.0.1 第一版。

安装

CocoaPods

  1. 在 Podfile 中添加 pod 'MLBPasswordTextField'
  2. 运行 pod installpod update
  3. 导入 <MLBPasswordTextField/MLBPasswordTextField.h>。

Carthage

暂未支持。

手动安装

  1. 下载 MLBPasswordTextField 文件夹内所有源文件。
  2. 将 MLBPasswordTextField 文件夹内所有源文件添加(拖入)到你的工程中。
  3. 导入 MLBPasswordTextField.h

系统要求

该项目最低支持 iOS 7.0+Xcode 8.0+

测试设备

真机

iPhone 7 Plus (iOS 10.1.1)

iPhone 5S (iOS 8.3)

iPhone 4S (iOS 8.1)

iPhone 4 (iOS 7.1.2)

模拟器

iPhone 6 (iOS 9.3)

iPhone 7 (iOS 10.1)

许可证

MLBPasswordTextField 使用 MIT 许可证,详情见 LICENSE 文件。

Latest podspec

{
    "name": "MLBPasswordTextField",
    "version": "0.0.5",
    "summary": "A custom password input like WeChat payment for iOS.",
    "description": "- A custom password input like WeChat payment for iOS.n- iOS 7+ .n- IB Designable.n- Cursor supported (~> 0.0.3)",
    "homepage": "https://github.com/meilbn/MLBPasswordTextField",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "meilbn": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/meilbn/MLBPasswordTextField.git",
        "tag": "0.0.5"
    },
    "source_files": [
        "MLBPasswordTextField",
        "MLBPasswordTextField/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "frameworks": [
        "CoreFoundation",
        "CoreGraphics"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This