annema.me

Find time zones where it's currently a certain time

Published on 05 May 2016

For a project I'm working I needed a function that returns the time zones where it's currently 9am. I generalized the function to be able to find time zones where it's currently any time. My Swift implementation was inspired by this stackoverflow answer, providing code for the same problem in…

Gesture Recognizers in Swift

Published on 09 Jul 2015

I wrote about using Gesture Recognizers in Swift for thatthinginswift.com. I ran into a couple of surprises using gesture recognizers in Swift. Nothing major, but definitely things to look out for. Head over to the article to read more about it. Nick is also looking for more contributors. If…

Ruby's tap method in Swift

Published on 18 Mar 2015

Ruby has a nice method called tap, which I wanted to try and port to Swift. To learn what it does, let’s take a look at Ruby’s documentation: Yields self to the block, and then returns self. The primary purpose of this method is to “tap into” a…

The Builder Pattern in Swift

Published on 02 Feb 2015

A while ago I wrote a post about implementing the builder pattern in Objective-C. Today we’re going to do the same for Swift. In the previous post the end result was: Pizza *pizza = [Pizza pizzaWithBlock:^(PizzaBuilder *builder]) { builder.size = 12; builder.pepperoni = YES; builder.mushrooms = YES; }]; There is a…

Configure your iOS app for multiple environments

Published on 20 Nov 2014

Two weeks ago I wrote a post about cleaning up your application delegate with initializers. I eluded to a Configuration object in that post. I decided to make this two separate posts because they’re different concepts that happen to work together. The Karma app has to run in 3…

Page 1 of 7 Older Posts →