Skip to content

KingCQ/IDCardKeyboard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IDCardKeyboard

CI Status Version Platform

IDCardKeyboard

A custom digital keyboard for idcard

👀 See also:

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 0.39.0+ is required to build IDCardKeyboard 3.0.0+.

To integrate IDCardKeyboard into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'IDCardKeyboard', '~> 1.0.8'
end

Then, run the following command:

$ pod install

📖 Usage

class ViewController: UIViewController {
  let textField: UITextField = UITextField()
  let fieldNext: UITextField = UITextField()
  
  override func viewDidLoad() {
      super.viewDidLoad()
      
      
      view.backgroundColor = .blueColor()
      textField.frame = CGRectMake(80, 400, 160, 30)
      textField.borderStyle = .RoundedRect
      textField.clearButtonMode = .WhileEditing
      textField.becomeFirstResponder()
      view.addSubview(textField)
      
      fieldNext.frame = CGRectMake(80, 500, 160, 30)
      fieldNext.borderStyle = .RoundedRect
      fieldNext.placeholder = "nextField"
      view .addSubview(fieldNext)
      
      textField.idcardKeyboard(view)//一句代码搞定数字键盘

      
  }
  

  override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
          UIApplication.sharedApplication().keyWindow?.endEditing(true)
  }
  
}

🔑 Basics Swift 2.2

About

手动实现简单的生份证数字键盘

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 66.7%
  • Ruby 33.3%