root-vb / otpfieldview Goto Github PK
View Code? Open in Web Editor NEWOne Time Password View for iOS. Built in Swift 5
License: MIT License
One Time Password View for iOS. Built in Swift 5
License: MIT License
Hi,
is it possible to customize the keyboard in order to make the return button NOT to add an empty char but to hide the keyboard?
It should be also very helpful to access to the updated string which I am tapping. Is there a var or a method which can show me the updated value?
Thanks for the support.
// Forcefully try to make first otp field as first responder
(viewWithTag(1) as? OTPTextField)?.becomeFirstResponder()
On this line app being crash .
Please let me know how could i fix it
I'm trying to implement OTPFieldView Delegation with SwiftUI but no luck.
Is there anyone who successfully implemented this repo?
My test:
import SwiftUI
import OTPFieldView
struct OTP: UIViewRepresentable{
func makeUIView(context: Context) -> OTPFieldView{
let otp = OTPFieldView()
otp.fieldsCount = 6
otp.displayType = .underlinedBottom
otp.separatorSpace = 8
otp.initializeUI()
return otp
}
func updateUIView(_ uiView: OTPFieldView, context: Context){
}
func makeCoordinator() -> Coordinator {
Coordinator(self)
}
internal class Coordinator: OTPFieldViewDelegate{
func shouldBecomeFirstResponderForOTP(otpTextFieldIndex index: Int) -> Bool {
return true
}
func enteredOTP(otp: String) {
print(otp)
}
func hasEnteredAllOTP(hasEnteredAll: Bool) -> Bool {
return false
}
var parent: OTP
init(_ parent: OTP){
self.parent = parent
}
}
}
Can we pass a string of characters to populate all fields ?
hello there,
i am using your code for a project and right now i'm getting stuck on how to close copy and paste in textfield and another thing is when i insert four value in text(i'm using only four fields) and then i'm clicking on third text and remove the value of that text then i want to click on fourth text but the text field is enable so please check it.
i'm waiting for your response.
Thank you
I am changing the border color and it is working fine in simulator but in iPhone it is not getting the border color. There is border color on simulator but on iPhone border color just takes white color.
I am trying to change the textColor of the textfield. but not able to do that
The fieldTextColor property is missing from the available customization options.
I have a use case where we send OTP to server. User can manually edit the OTP in OTPFieldView. If server gives message OTP is wrong, we need to show OTP Field view in red border. With current implementation it is not possible. Is there any way to do that?
Hello,
i have been trying to add the otp i got from a service and since iOS 12 its possible to show that sms otp into keyboard suggestion. so we can just tap that and otp field will be filled with provided data.
[!] CocoaPods could not find compatible versions for pod "OTPFieldView":
In Podfile:
OTPFieldView
Specs satisfying the OTPFieldView
dependency were found, but they required a higher minimum deployment target.
nestap@Nestaps-MacBook-Pro nestap_
Can't find a way to clear text field
Does your library supports autofilling of digits to respected position?
otptextField.textContentType = .oneTimeCode
@Root-vb Please Help ME
-> When user taps on any otp box, cursor should show after the number instead of before the number.
I've add this control programtically.
It's layout is broken and can't implement.
Hello
I am using your code in one of the project. And in my project one of the requirement is to copy paste OTP. So If User copy OTP from anywhere and paste the code, it will fill all the OTP filed views with pasted OTP. Right now what happen is that, if I copied 123456 and paste, the whole OTP is pasted in first textfield only. But I want to paste only single character in each of textfield.
So please can anyone give me the solution for that.
Waiting for the response.
Thanks in advance.
Hello there,
I am using your code for a project and right now I'm getting stuck on how AutoFill one-time security code!
how to get PIN after entered???????
I am trying to install OTPFieldView in my iOS project using terminal but it gives an error that says
[!] CocoaPods could not find compatible versions for pod "OTPFieldView":
In Podfile:
OTPFieldView
Specs satisfying the OTPFieldView
dependency were found, but they required a higher minimum deployment target.
How can I install OTPFieldView?
Please assist with a suitable demo of this, tried following the guide on your site but it is not working at all.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.