-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Center tokens. #69
base: master
Are you sure you want to change the base?
Center tokens. #69
Conversation
…eldAlignmentRight.
…xtAlignment mirrors tokenField alignment.
…eldAlignmentRight.
…ext field location based on text length.
…lignment property.
@@ -24,15 +24,12 @@ | |||
|
|||
@implementation VENBackspaceTextField | |||
|
|||
- (BOOL)keyboardInputShouldDelete:(UITextField *)textField | |||
{ | |||
- (void)deleteBackward { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keyboardInputShouldDelete
seemed to prevent textField:shouldChangeCharactersInRange:replacementString
from being called on backspaces (and possibly other unknown side effects). deleteBackward
doesn't seem to have the same limitation.
|
Found a solution that works from here but seems risky in terms of getting rejected for private API usage... @ayanonagon ideas? |
Also deprecated
minInputWidth
.When adding logic to center icons, I also modified the logic for positioning the
inputTextField
. Now, the text it contains is treated like a token. So, theinputTextField
goes wherever the token positioning logic puts this placeholder token (whosetitleText
is the current text in theinputTextField
). Because the token locations are now refreshed every time the user inputs a character, thetokenField
will now create newlines while the user types as necessary, eliminating the need for aminInputWidth
.More frequent updating of the token locations is critical for centering to maintain the "centered" feel as illustrated by the gif below.
Fix #66.