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

Better way to assign type #1

Open
khawars opened this issue Nov 26, 2015 · 2 comments
Open

Better way to assign type #1

khawars opened this issue Nov 26, 2015 · 2 comments

Comments

@khawars
Copy link

khawars commented Nov 26, 2015

Hi @gali8. Thank you for great work :)
This is not a bug, but I just wanted to describe my experience with this code.
There should be a way to assign an Enum to regexPatternEnum instead of a number. Like:
myTextField.regexPatternEnum = .Email

Currently, it is
myTextField.regexPatternEnum = 9

which is not very descriptive.

Please add this feature in future version of this code.

@gali8
Copy link
Owner

gali8 commented Nov 27, 2015

Hi there,
I know. Unfortunatelly using the @IBInspectable property, you can't write enums into the storyboard (so a Int is required).
Anyway, I will update the class so you can choice (programmatically) the right regexPatternEnum, using... enums :) like you suggest.

Last, you can obtain the same result using the regexPattern property and the rawValue of enums:

myTextField.regexPatternEnum = 0 //that's the default, you can ignore it.
myTextField.regexPatternCustom = RegexPatternTypes.Email.rawValue

@khawars
Copy link
Author

khawars commented Nov 27, 2015

Thank you @gali8. I'll wait for the update. (y)

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

No branches or pull requests

2 participants