Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Center tokens. #69

wants to merge 12 commits into from

Conversation

neerajbaid
Copy link
Contributor

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, the inputTextField goes wherever the token positioning logic puts this placeholder token (whose titleText is the current text in the inputTextField). Because the token locations are now refreshed every time the user inputs a character, the tokenField will now create newlines while the user types as necessary, eliminating the need for a minInputWidth.

More frequent updating of the token locations is critical for centering to maintain the "centered" feel as illustrated by the gif below.

tokenfield

Fix #66.

@@ -24,15 +24,12 @@

@implementation VENBackspaceTextField

- (BOOL)keyboardInputShouldDelete:(UITextField *)textField
{
- (void)deleteBackward {
Copy link
Contributor Author

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.

@neerajbaid
Copy link
Contributor Author

deleteBackward seems to be broken in iOS 8-8.2 (a known bug). Looking into solutions.

@neerajbaid
Copy link
Contributor Author

Found a solution that works from here but seems risky in terms of getting rejected for private API usage... @ayanonagon ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tokens center alignment
1 participant