xornorik / svpinview Goto Github PK
View Code? Open in Web Editor NEWSVPinView is a light-weight customisable library used for accepting pin numbers or one-time passwords.
License: MIT License
SVPinView is a light-weight customisable library used for accepting pin numbers or one-time passwords.
License: MIT License
There is a delay of pin entries being secure when typing fast
I am having trouble initializing the SVPinView.
What should i pass as it's coder parameter ??
var view = SVPinView() // this is not allowed
var view = SVPinView(coder : NSCoder) // this also returns error
i'm trying to using pastepin and app crash on this line
let textField = collectionView.cellForItem(at: IndexPath(item: index, section: 0))?.viewWithTag(101 + index) as! SVPinField
also can you make wrong state for next release
thanks
// store text
let text = textField.text ?? ""
let passwordIndex = index - 1
if password.count > (passwordIndex) {
// delete if space
password[passwordIndex] = text == " " ? "" : text
} else {
**//it is wrong, it should input to the index it should be.
password.append(text)**
}
validateAndSendCallback()
Specs satisfying the SVPinView
dependency were found, but they required a higher minimum deployment target. please help . thank you
After adding @objc annotation to that property, it works. Rather add @objcMembers to SVPinView class
On gif from readme text and cursor are aligned to horizontal center of each line.
Created test project with this control - on editing text alignment changes from "center" to "left" - independently on empty or non-empty text field.
Is it possible to update the size of the input areas?
I can manage to get the width about accurate based on where I need to place this, but the height of each input area is too small.
Unknown class SVPinField in Interface Builder file.
Assertion failure in -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:],
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the cell returned from -collectionView:cellForItemAtIndexPath: does not have a reuseIdentifier - cells must be retrieved by calling -dequeueReusableCellWithReuseIdentifier:forIndexPath:'
I have an issue with iPhone 6s - iOS 13.7. Autofill doesn't appear on the top of the official keyboard of the iOS.
It seems this behavior is occurred just on iPhone 6 - 6s
Here a buch of my code:
lazy var verificationTextField: SVPinView = { let textField = SVPinView() textField.translatesAutoresizingMaskIntoConstraints = false textField.pinLength = 6 textField.interSpace = 5 textField.borderLineColor = .red textField.activeBorderLineColor = .black textField.borderLineThickness = 1 textField.activeBorderLineThickness = 3 textField.becomeFirstResponderAtIndex = 0 textField.keyboardType = .numberPad textField.isContentTypeOneTimeCode = true textField.style = .underline return textField }()
I had this issue in some projects where setting pin length to another length rather than the default value would update the view but the password count is still 5 leading to either crashes when the pin length is greater than the default value or not triggering didFinishCallback if less than 5.
I fixed this issue by moving the password array initialization to the collection view delegate method numberOfItemsInSection rather than in loadView that gets called in init method.
SVPin version : 1.0.6
Deployment Target : iOS 11
it doesn't appear in iOS 12.1 projects though.
I have set pin length to 4 and style to underline. Then the borderline color is not working (Whatever color you set, it's showing as clear color) but it is working for 6 pin.
halo help me , when i'm using this always crash on this line
let textField = cell.viewWithTag(100) as! SVPinField
halo help me , when i'm using this always crash on this line
let textField = cell.viewWithTag(100) as! SVPinField
I got this issues after updating my cocoapods. Any idea how to fix this?
SVPinView version is 1.0.5
Swift 4.1
I have installed v.1.0.4
but in this version, there is no didChangeCallback method.
How can I catch the change listener?
Increasing height of view is not going to increase the height of pin view how can is solve this?
please append keyboardAppearance for UIKeyboardAppearance
I have a case where i need to change my PIN style text color, underline color when the PIN input is invalid. I can't seem to do this without calling pin.clearPin()
which will reload the view and clear all the input. Is there another way to do this?
Thanks
Using Xcode 10.1 with Swift 4.2.1 (same on Xcode 10 w/ Swift 4.2)
Getting a compile error, which is an easy fix. Basically in ‘SVPinView.swift’ - on line 87, change these 2 uses of ‘UIViewAutoresizing’ to ‘UIView.AutoresizingMask’
... in case anyone needed this and for an update. Thank you for your repo!
Since iOS 14 the SVPinview shows a "xxx pasted from yyy" notification whenever i enter text/number into a SVPinView. Looks like the UITextField needs to be modified and disable clipboard actions. Or can this be done already? If so how?
Pin entry should always be left to right
Is there any way we can achieve this with this framework. Since iOS 12 has introduced this feature.
static let oneTimeCode: UITextContentType
How can I turn off the keyboard loss feature at the end?
1.hope to provide milliseconds property to set secure text after a bit, some time we don't need delay show secure text
2.when press delete key of keyboard wanna delete previous char or not just move the cursor to the text field
thanks
view controller with code is not enough
Hi!
Is there any chance to do "Show Pin" functionality?
I'm using English and Arabic Localization for my app and I have used this Pinview within my app. This is automatically changing the alignment from Left to Right. I do not want the change in the alignment.
I want to have the same as it is, like first textfield will start from left and last textfield on the right. I want this similar functionality in both English and Arabic.
First of all thank you for the library. I am using your library in one of my project and setting "interSpace" is not working properly. If I set a space using this property then interspacing between views goes to 0. Could you please look into it?
In underline mode currently, all the underlines are in the same color. May I suggest two useful feature additions:
I have put the field and wish it to be the FirstReponder on a view. But nothing I do can make the field become focussed as the first responder and bring up the keyboard? I have to click on the field to bring up the keyboard.
first of all thanks for this project. Are you plan to support Carthage?
How to use this library with SwiftUI?
it might be too much for this view. but it would be nice if the textfields themselves start animating until the network request finishes.
Hi;
Thanks for your work.
I wrap your view in a SwiftUI app.
In this app I see an odd behavior. If the user tap a single pinView in the left half of the view it can prevent the overwrite of the existing character.
I attach two screenshot to explain better myself. In the first (indicator is on the left) if the user digit a new character then the old one is not overwrite, in the second it will be overwrite.
Notice the indicator on the left side of the char.
notice the indicator on the right side of the char. In this case work
Created a view which intherits SVPinView
and fulfills almost the whole screen.
Result: numbers are aligned to vertical center, lines aligned to bottom. They should be aligned to the same anchor point.
Hitting backspace while the cursor is in char index 0 position exits the field. I think that is a bug. Most PIN entry will not exit, but actually remain in position index 0 if the backspace key is used there.
Hi,
SPView doesn't work with textContentType = .oneTimeCode (ex: add textContentType to the first SVPinField).
Any idea how to solve the issue?
2020-04-17 09:01:25.854738+0800 nookprint[88745:19458510] *** Assertion failure in -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3899.22.15/UICollectionView.m:2248
2020-04-17 09:01:25.858613+0800 nookprint[88745:19458510] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the cell returned from -collectionView:cellForItemAtIndexPath: does not have a reuseIdentifier - cells must be retrieved by calling -dequeueReusableCellWithReuseIdentifier:forIndexPath:'
I have copy source folder into xcode project
and then in my XIB added View of subclass SVPinView
added required properties and crashes on starting
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the cell returned from -collectionView:cellForItemAtIndexPath: does not have a reuseIdentifier - cells must be retrieved by calling -dequeueReusableCellWithReuseIdentifier:forIndexPath:'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23e3cc88 +[NSException raise:format:arguments:] + 88
3 Foundation 0x00007fff258b8bd2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
4 UIKitCore 0x00007fff484367de -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 1277
5 UIKitCore 0x00007fff484362db -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 31
6 UIKitCore 0x00007fff4843bb7b -[UICollectionView _updateVisibleCellsNow:] + 6402
7 UIKitCore 0x00007fff48440cca -[UICollectionView layoutSubviews] + 351
8 UIKitCore 0x00007fff49193678 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2478
9 QuartzCore 0x00007fff2b4c6398 -[CALayer layoutSublayers] + 255
10 QuartzCore 0x00007fff2b4cc523 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 523
11 QuartzCore 0x00007fff2b4d7bba _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 80
12 QuartzCore 0x00007fff2b420c04 _ZN2CA7Context18commit_transactionEPNS_11TransactionEd + 324
13 QuartzCore 0x00007fff2b4545ef _ZN2CA11Transaction6commitEv + 649
14 UIKitCore 0x00007fff48ca3747 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 81
15 CoreFoundation 0x00007fff23da0b5c CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12
16 CoreFoundation 0x00007fff23da0253 __CFRunLoopDoBlocks + 195
17 CoreFoundation 0x00007fff23d9b043 __CFRunLoopRun + 995
18 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404
19 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139
20 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605
21 App 0x000000010b0027bb main + 75
22 libdyld.dylib 0x00007fff51a231fd start + 1
23 ??? 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
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.