Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions OTPFieldView/OTPFieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ import UIKit
}
}
}

public func setFullOTPCode(_ code: String) {
secureEntryData = code.map { String($0) }
for index in 0 ..< secureEntryData.count {
if let otpField = viewWithTag(index + 1) as? OTPTextField {
otpField.text = secureEntryData[index]
}
}
}

}

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ extension OtpViewController: OTPFieldViewDelegate {
- **shouldBecomeFirstResponderForOTP()**: Show keyboard automatically.
- **enteredOTP()**: Get entered pin.


### Set full otp code

```swift
self.otpTextFieldView.setFullOTPCode("22222")
```

- **setFullOTPCode()**: Use in case of setting OTP code in OTPTextViewField programmatically.

### Properties

- **.displayType**: Display type for Text Field.
Expand Down