     })
   }
 }
+
+private extension TextField {
+  /// Visibility icon based on isSecureTextEntry value.
+  var visibilityIcon: UIImage? {
+    return isSecureTextEntry ? visibilityIconOff : visibilityIconOn
+  }
+}

        return
      }
      
      visibilityIconButton = IconButton(image: isSecureTextEntry ? Icon.visibility : Icon.visibilityOff, tintColor: placeholderNormalColor.withAlphaComponent(0.54))
      visibilityIconButton!.contentEdgeInsetsPreset = .none
      visibilityIconButton!.pulseAnimation = .centerRadialBeyondBounds
      isSecureTextEntry = true
      clearButtonMode = .never
      rightViewMode = .whileEditing
      rightView = visibilityIconButton

          return
        }
        
        v.image = self.visibilityIcon
    })
  }
}
