Closed aleufms closed 10 years ago
There's no point in assigning a nil mask to an UITextFieldMask
. It will work similarly to a regular UITextField
but it will actually be slower because of the preprocessing there is before sending forward the messages to the textfield's delegate.
Can you give me a real example of why this could be interesting? I honestly can't see how this could happen.
It's because I have a base class for all input views. I have a base class called MYTextField : UITextField, so I can set a lot of common properties (that not supported in appearance framework) for all textfields in my application. I want to use masks in some fields, so I would subclass MYTextField : UITextFieldMask instead UITextField and set mask only on textfields that require the mask.
You can check if mask is nil and ignore the preprocessing. It will have an overhead, but I think it is not critical.
I'll see what I can do, but I won't be able to touch this code this week. If you need it ASAP, feel free to fork the project and try to tweak it.
If you succeed, do a pull-request and I'll review it.
I added ARC support and your request.
Check it out: 7db83bff71c889682694c422da5327c0658a7286
Oh, nice. Thank you. Valeu!!!
I think it's better that a textfield with mask = nil would have a behavior equals a normal uitextfield. So, it can be a drop in replacement for it.