[Swift] Quick number to word conversion

[Swift] Quick number to word conversion

If you’re ever setting content for things using loops (who isn’t, right?), you might often use the loop variable in a string to label something. Item 1, Item 2, etc. Especially when you’re simulating or prototyping something that will consume actual live data later on.

A nice touch is to get rid of those numerals in your labels or other text controls. They look so… engineer. Meaning more function over form. I like both.

Slap this into your loop and set your labels with more care.

Such a tiny bit of code and it really does dress things up nicely. Some might even think that you’ve set up an array of String values and populated using that.

Crazy. As in crazy good.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.