Latest 1.0.0
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit

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



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

Adding RNMaskTextField to your project


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


  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
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": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Romilson Nunes": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "1.0.0"
    "source_files": "RNMaskTextField/*",
    "frameworks": "UIKit",
    "requires_arc": true

Pin It on Pinterest

Share This