Posts tagged 'Swift'

2015

Displaying phrases containing numbers

I’m in the middle of writing an app in Swift which requires an alert to appear which says something like “10 questions entered”. But of course some times it should say “1 question entered”. The traditional approach to the question/questions situation is to either test for the number and create a string accordingly or to use the rather tacky “question(s). As I needed similar phrases in a number of places, I decided that the best approach was to create a function. Although the app I’m writing is for OSX, the functions described below should work in iOS as well.

Read More

Up and running!

Although I registered with GitHub nearly two years ago, it was only today that I started using it. I’ve been rummaging around with both blogging and programming for many years without any great sense of direction; but the conjunction of three things has led to this blog.

Read More