Recent articles

Jump to a random post

About my iOS development book…

Published on: December 11, 2017

It's been almost two years since I blogged on this page. I know, two years is a long break for a person that claims to love "Writing about my everyday coding problems and solutions". Well, there is a very valid reason for my absence because I have been working on a book! Two actually, but they're mostly two sides of the same coin. My first book ever is named "Mastering iOS 10 Programming". It's been published by Packt Publishing and with it you can learn all the awesome new iOS 10 goodies that Apple introduced last year. If you're about...

Read more...

Enforcing modular code with frameworks in Xcode

Published on: July 17, 2016

Every iOS developer I know dreams of writing code that’s DRY, modular, testable and reusable. While this is a great goal to strive for it’s often quite hard to write code that is completely modular. It just takes one oversight to blow most of the modularity you have achieved right out the window. One technique that people use to make it easier to write modular code is to try and ensure that a certain part of their code, for instance the networking logic or their models, know nothing about other parts of the app. Again, a great idea but this...

Read more...

Surviving a start-up’s bankruptcy

Published on: June 13, 2016

On a Tuesday almost two months ago, near the end of april, me and my coworkers received an email about an important meeting the next. We knew that something was going on, the look and feel of this email wasn't the same as usual. This one seemed a bit darker, a bit more serious. On Friday you could feel the tension in the office, people were speculating a bit and just acting different than usual. But we all had jobs to do and we tried to do them just like we always did. But it turns out that this tension...

Read more...

On variable naming when teaching

Published on: May 28, 2016

One of the hardest things a programmer has to do on a daily basis is naming things. Anything that we name will stay with us for a while and it's very likely that other programmers will have to use the thing we just named as well. So naming something properly is very important. It's often said that the two hardest problems in programming are naming things and cache invalidation. I tend to agree with that statement. A lot of times when I struggled with a piece of code, naming could have made my struggle easier. A function name like fetchData...

Read more...

Apple has launched Safari Technology Preview (and that’s great news).

Published on: March 31, 2016

For a long time web developers have been complaining about the lack of updates (and modern features / APIs) for Safari. With the current release cycle for Safari we get a major updated version with every major OS release (which only happens once a year). This release cycle, and the lack of new features in Safari made some people go as far as calling Safari the new IE. NowApple has launched Safari Technology Preview. Developers can use this browser to try out new web features way before they land in the consumer version of Safari. The developer version is based...

Read more...

Build a simple web scraper with node.js

Published on: February 29, 2016

Recently I released my first personal iOS app into the wild. The app is called unit guide for Starcraft 2 and it provides Starcraft 2 player with up to date and accurate information for every unit in the game. Instead of manually creating a huge JSON file I wrote a web scraper in node.js that allows me to quickly extract all the data I need and output it in a JSON format. In this post I will explain how you can build something similar using techniques that are familiar for most web developers. Step 1: preparing Before you get started...

Read more...

Clean derived data from Xcode, the simple way

Published on: February 26, 2016

Update for Xcode 11: Unfortunately, it appears that this method of cleaning derived data no longer works😕. Looks like we're stuck purging ~/Library/Developer/Xcode/DerivedData/ by hand again. If you do know of a workaround similar to the one described here, send me a tweet and I'll update this post! Any iOS developer that has spent significant time with Xcode is familiar with at least a couple of it's caveats. Random crashes, slowness, autocomplete not working for a few seconds and build errors right after you've added or removed a library. Or, just a random appearance of 200+ warnings like I had...

Read more...

Wrapping your callbacks in Promises

Published on: November 2, 2015

A little while ago I wrote a post about PromiseKit. In this post I wrote mainly about how you could wrap API calls in Promises using the NSURLConnection extension that the creator of PromiseKit provides. Since writing that article I've had a bunch of people asking me more about PromiseKit. More specifically, some people wanted to know how they could wrap their existing code in Promises. To illustrate this I'm going to use Parse as an example. A regular save action in Parse Before we start making Promises, let's have a look at how you'd normally do something with Parse....

Read more...

How I migrated from Apache to Nginx

Published on: September 5, 2015

It's no secret that nginx has certain advantages over apache. One of them is that nginx is supposed to have better options for forwarding requests to ports other than port 80. My VPS has been using apache ever since I set it up because at the time apache was the only server I knew how to install and set up. But, as I learned more and wanted to start using different ports for node.js or python apps, I figured that I needed to move over to nginx. And so I did. In this post I will describe how. Preparing When...

Read more...

Step up your async game with PromiseKit

Published on: September 3, 2015

Some of the most engaging apps we use today are apps that require network connectivity of some kind. They communicate with an API somewhere to fetch and store data for example. Or they use an API to search through a huge amount of data. The point is, you don't want your application to sit around and wait while an API call is happening. The same is true for a computing task that's heavy, for example resizing an image or storing it to disk. You want your UI to be snappy and fast. In other words, you don't want to do...

Read more...