Empty or optional arrays

I needed to be able to change the colour of my entire interface when the user tapped a button. My first design consisted of a series of labels that were easily referenced by outlets. Later I decided a Table View was a better fit – but how to retrospectively update the colours of the table cells?

Using computed properties to provide display values for stored properties

I have a model class which keeps, amongst other things, the user’s current location.

While the location is used for internal calculations, there is also a screen where I display the current location to the user. Formatting the two values for display is easy enough, but non-trivial and worth encapsulating. I found the simplest way to encapsulate it was by creating a computed property on the model class itself.

Substrings

I guessed I’d find a nifty article on just about any Swift topic I needed, which could be linked here. I was wrong. I came to the below conclusion because I couldn’t find any articles (easily) which answered the problem and so had to go digging deeper for myself.

Apple’s official Swift tweets

So, after I came up with this idea, found the domain available, created the web site and tweaked it to my liking – I discover there is what appears to be an official @swifttips Twitter account from Apple.

Hopefully they don’t get upset about this little site – or maybe they’ll buy the domain for millions. I can only hope. 🙂