annema.me

Occassional writings about programming and software.

May 5, 2016

Find time zones where it's currently a certain time

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...

Jul 9, 2015

Gesture Recognizers in Swift

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...

Mar 18, 2015

Ruby's tap method in Swift

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...

Feb 2, 2015

The Builder Pattern in Swift

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...

Nov 20, 2014

Configure your iOS app for multiple environments

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...

Oct 30, 2014

Clean up the application delegate with initializers

The application delegate has a tendency to become unwieldy. It provides a ton of callbacks to respond to about every possible state change of your app. The method that grows...

Jul 2, 2014

Adopting a new programming language

Over the course of my short career I’ve had the opportunity to build production-quality software in many new languages. I like learning new languages. I think it makes me a...

May 27, 2014

Hour formatting with NSDateFormatter dateFormatFromTemplate

TLDR; Using NSDateFormatter’s dateFormatFromTemplate:options:locale: for 12/24 hours? Use “j” instead of “h” or “H” for the hour format. Last week I started a fight with NSDateFormatter. I needed to format...

May 19, 2014

Builder and GCC Code Block Evaluation

My post about the builder pattern got great responses and a lot of people offered alternative solutions to the same problem. The most popular suggestion was to use GCC Code...

Apr 9, 2014

TDD - Classicists vs Mockists

A while ago I reread Martin Fowler’s classic mocks aren’t stubs essay. He does a great job of explaining the different schools of TDD. In summary it basically comes down...

Apr 4, 2014

The Builder pattern in Objective-C

Learning Android and by extension Java has given me some new patterns to apply in my Objective-C code. The one that I’m most excited about is the builder pattern. The...

Apr 2, 2014

Android adventures #3 - Testing

Due to an injury I had to suspend training for my first half marathon for the remainder of the week. I found myself with some extra time yesterday morning. I...

Mar 31, 2014

Android adventures #2 - The first crash

Last week we introduced bug fix monday’s at Karma. The goal is to have a dedicated day to fix bugs that we usually don’t have time for. Because, you know,...

Mar 27, 2014

Android adventures #1 — Perform task on launch

I’m going to try and apply the Brent Simmons approach to Android development. This is the first installment. I need a way to do something when my Android app is...

Mar 25, 2014

The Pomodoro Technique

A while ago I started working with The Pomodoro Technique. I initially had my reservations but after using it semi-consistently for a couple of months I don’t see myself going...

Feb 7, 2014

Problems with iOS Push Notifications

Push notifications are a great way to keep users engaged with your iPhone app. The amount of applications that support them led me to conclude that supporting push notification must...

Jan 22, 2014

Why I prefer testing with Specta, Expecta and OCMockito

Update August 2014: Since writing this article, OCMock has released major version 3. Everything said about OCMock is based on version 2. If you’re testing your Objective-C code (you should)...

Jan 14, 2014

Initializing Objective-C classes with sane initial state

Because Objective-C has the concept of designated initializers, you have to ensure your classes are instantiated using sane initial state. Take for example a fictitious person class with the designated...

Mar 5, 2013

Appreciating real world interaction

Moving to New York and having to quickly adept to a completely different culture has really opened up my eyes to a lot of beautiful interactions we encounter during our...

Jan 12, 2013

Debugging Ember

While building the Karma customer dashboard I discovered several interesting ways to debug Ember apps. Some of these are my own, others I’ve taken from Tom Dale’s excellent debugging Ember...

Mar 16, 2012

CSS Markdown mark

I’ve been impressed with icons created in CSS3 and decided to have a go at it. As an experiment I took Dustin Curtis’ markdown mark and made a version using...

Sep 8, 2011

Changes to AppEngine's _from_entity

Both my blog and Enstore experienced a serious outage today. This was caused by a recent change to how App Engine initializes entities. The error was: BadArgumentError: Cannot use key...

Apr 28, 2011

My git setup

I have been using git since I started working on Cappuccino. Over time I’ve found several useful additions to my configuration that made working with it easier. Bash additions While...

Mar 5, 2011

Announcing autonib2cib

Some time ago I posted a gist for a command line utility that automatically nib2cibs changed nibs. During the weekend I’ve rewritten the utility, making it more reliable with newly...

Nov 5, 2010

Improving the Cappuccino Theme System

I’ve written about the Cappuccino theming system before1 and I have a confession to make, I don’t like the current system. Let me clarify. Being able to change every visual...

Sep 16, 2010

Cappuccino Custom Themes

A while ago I wrote a blog post about the basics of Cappuccino theming. Since then I’ve got a lot of questions about how to create fully customized themes. The...

Jul 22, 2010

NSConference MINI 2010 Sessions Online

This year, European developers had a hard time attending the WWDC, Apple’s developers conference. The announcement was to late, forcing developers to arrange an entire inter continental trip in a...

Jul 19, 2010

The future

Most of you probably already know, but for those who don’t; the company I work at, Sofa was acquired by Facebook. For reasons I can’t disclose I was not part...

May 15, 2010

Programmatically Scroll a UIWebView

Ever wanted to scroll a UIWebView programmatically on the iPad or iPhone? Unfortunately Apple doesn’t have a public API to do this, but there is a way. A UIWebView can...

Apr 6, 2010

The Basics of Cappuccino Theming

This is the second post of a series of posts about Cappuccino where I explain the subjects I talked about during my CocoaHeads Amsterdam presentation. The first post can be...

Mar 19, 2010

Objective-J Explained: Toll-Free Bridges

Last week I gave a talk on the Cappuccino frameworks during a Cocoaheads Amsterdam meeting. This post is the first in a series in which I’ll explain several of the...

Mar 8, 2010

Welcome!

After some delay it's finally here. Welcome to my blog! I intend to post here whenever I learn something new and interesting. I don't have a specific subject in mind,...

This project is maintained by klaaspieter