Ios validating text input

Posted by / 11-Dec-2017 01:33

What happens if we need a common solution for our favorite target platforms: Windows 10 UAP, Android and i OS?

As DRY principle lovers, we always think about reusing as many code artifacts as possible.

After a small research about validation engine provided by UAP platform, we found this great article by Jerry Nixon, that we recommend as a very interesting read.

It seems that we need to create some custom validation classes, so we can work in our own solution with Jerry’s approach as source of inspiration.

For example, if you’re implementing a search field, you might want to update the search results as the user types their query.

If user introduces an invalid value, a red message should appear.

For UAP, an easy approach is to extend core Textbox, creating a new class called Validation Text Box, and modifying its control template to add a custom red Text Block bound to property first error message.

Other interesting subscription is the one related with view model Property Changed.

In this case, we can use the property to enable or disable submit button.

ios validating text input-28ios validating text input-59ios validating text input-56

Again, we need to subscribe to some control events to provide automatic validation: Editing Changed and Editing Did End events.

One thought on “ios validating text input”

  1. You'll probably meet him on St-Laurent after 3am on like a Tuesday or something. He still probably smokes a lot of weed and uses words like "yo", "dope" and "bae". They passionately start different projects every week and firmly believe they will be millionaires by the time they reach 30.