Latest 1.0.0
Homepage https://github.com/souzainf3/RNMaskTextField
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

It is a subclass of UITextfield to Provide the mask and message error label.

RNMaskTextField

Requirements

  • iOS 8.0+ / Mac OS X 10.9+ / Apple TV 11
  • Xcode 9.0+, Swift 4

Adding RNMaskTextField to your project




Cocoapods

  1. Add a pod entry for MaskTextField to your Podfile pod 'RNMaskTextField'
  2. Install the pod(s) by running pod install.

Manually

  1. Drag MaskTextField.swift and FormTextField.swift to your project

Using RNMaskTextField

  • Show a message of error in your TextField

    self.textField.showAccessoryLabel(withText: "Message Error")
  • Set a mask to your TextField
    
    self.textField.textMask = "###.###"

/// Set the textField delegate and call the function shouldChangeCharacters(…)

extension ObjectObserver: UITextFieldDelegate {

func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
return (textField as! MaskTextField).shouldChangeCharacters(in: range, replacementString: string)
}
}


### MaskTextField Properties

* Text Mask
```swift
textMask: String

*Default Char Mask

defaultCharMask: String = "#"

FormTextField Properties

  • Draw Text with edge insets. Default is .zero.
    textEdgeInsets: UIEdgeInsets

    *Accessory Font

    accessoryFont: UIFont

    *Accessory Text Color. Default is .red

    accessoryTextColor: UIColor
  • Shake AccessoryLabel when Showing text. Default is true
    shakeAccessoryLabel : Bool

Latest podspec

{
    "name": "RNMaskTextField",
    "version": "1.0.0",
    "summary": "UITextfield with mask and message error",
    "description": "TIt is a subclass of UITextfield to Provide the mask and message error label..",
    "homepage": "https://github.com/souzainf3/RNMaskTextField",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Romilson Nunes": "[email protected]"
    },
    "social_media_url": "http://twitter.com/souzainf3",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/souzainf3/RNMaskTextField.git",
        "tag": "1.0.0"
    },
    "source_files": "RNMaskTextField/*",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This