Skip to content

Releases: huyparody/OTPTextField

1.0.3

Choose a tag to compare

@huyparody huyparody released this 12 Jun 11:15

[1.0.3] - 2025-06-12

Changed

  • Refactored OTPTextField to handle .invalid state change separately via .onChange(of: typingState) instead of mixing it inside .onChange(of: text).
    This improves code clarity and avoids potential side effects when typingState changes independently from the text input.

1.0.2

Choose a tag to compare

@huyparody huyparody released this 12 Jun 10:36

[1.0.2] - 2025-06-12

  • 🔧 Removed textFieldWidth option from OTPTextFieldOptions.
    This decision was made to better support adaptive layouts by allowing each text field to automatically expand and fill the available horizontal space based on the number of digits and spacing. Fixed-width fields were limiting flexibility, especially on devices with varying screen sizes.
  • Removed unused initializer.

1.0.1

Choose a tag to compare

@huyparody huyparody released this 12 Jun 10:28

[1.0.1] - 2025-06-12

1.0.1

  • 🔧 Removed textFieldWidth option from OTPTextFieldOptions.
    This decision was made to better support adaptive layouts by allowing each text field to automatically expand and fill the available horizontal space based on the number of digits and spacing. Fixed-width fields were limiting flexibility, especially on devices with varying screen sizes.

1.0.0

Choose a tag to compare

@huyparody huyparody released this 12 Jun 07:33

[1.0.0] - 2025-06-12

Added

  • OTPTextField component for customizable OTP input UI.
  • Support for two styles:
    • .underlined
    • .roundedBorder
  • OTPTextFieldOptions to allow customization (colors, spacing, font, etc.).
  • Binding to @State var text: String and @State var typingState: TypingState to control and observe input.
  • Invalid input animation trigger via external .invalid state.
  • Callback onComplete when full OTP is entered.
  • Hidden internal TextField for native iOS OTP auto-fill support.
  • Support for SwiftUI @FocusState to manage focus state cleanly.