Hi Anton, thank you for your replay, much appriciated . I’m always happy to hear the readers side and there (your) opinion.

Moving to your suggestion I think that you are absolutely right a “for-loop” could be smarter to use in this case, the reason I didn’t use it though is that looping Enums has only been introduced in Swift 4.2 and this code is writing in Swift 4.1. Although there are solutions to iterite enums in Swift 4.2 and below I choose not to do that to simplify things for any futures developers.

In my opinion readable code is more imortent then saving a few lines of code, if you understood my code as it is right now, then I did my job explaining correctly, now its up to you to add more date formats and improve the code and shape it as you think is right.

I wish to teach and inspire other developers to take a code sample and improve it , not copy paste and get it done with.

Thanks agian for your comment :) Hope you could read and comment any future articles of mine.

Senior iOS Developer @ Lili

Senior iOS Developer @ Lili