My challenge for 2015 – One sketch a day!

I suck at drawing. Really, it’s that bad. You could give a pencil to a two year old and get more out of it as I would. I wanted to draw better for so many years but never really started to improve something. So why not try it by setting a personal challenge for the new year? I think that’s a good idea to motivate myself to finally improve my drawing skills (at least a bit). There is no certain goal for this challenge, I hope my abilities to draw what I see (or think of) will improve by a huge amount if I just draw…So  I did not set any specific rules, except one: draw one sketch a day, regardless how!

In the moment I think most of the sketches will be done on iPad with one of my favorite drawing apps: Paper or ProCreate. Check them out if you don’t know them, these are brilliant pieces of software! I will post every image on my blog with slight edits in Pixelmator at max. Since the year is already some days old I will try to catch up some sketches, if I don’t get it the challenge will last as long as I’ve got 365 unique sketches.

Okay, now let the sketching begin!

How to install new Xcode themes

If you are not that satisfied by the default syntax highlighting in Xcode and the pre installed themes aren’t that useful for you there is an easy way to install some new ones. At first, open Finder and navigate to:

~/Library/Developer/Xcode

(to do so press cmd+shift+g and type in the folder). now create a new folder called

FontAndColorThemes

You are now ready to color up Xcode with new themes. To find some a good starting point to search on github.com for “Xcode themes”. Typically you will find a file with the ending:

.dvtcolortheme

Copy this file to the newly created directory. If you restart Xcode now you will see your installed themes under Preferences-Fonts & Colors. If everything went fine it should look like this:

fonts_colors

Saving data with UIDocument in iOS

Reading and writing data in iOS is a crucial thing if your app depends on it. In my app Stepr (iTunes link). I’ve made the naive mistake to save all my data into a plist file with a (too) simple mechanism and made my users not very happy with this approach. Stepr is basically a pedometer which reads the data from the M7 coprocessor in the iPhone 5s, compares it to a goal set by the user and saves all steps of a day into a file (more on this in a separate post). The user can view all the recorded steps afterwards in a statistic and watch the overall progress.

So what was wrong with saving into a plist file? In general – nothing. If you when your data is loaded and ready to get saved you are (probably) fine. But for Stepr things are a bit more complicated. The app utilizes Background Fetch to update the data even when the app is not active. Stepr will be launched in the background and gets about 30 seconds to do its stuff till iOS will quit it and querying the CoreMotion framework is threaded too, so you don’t really know when updates are done. So in the worst case Stepr tried to load data, tried to update it and saved it at nearly the same time. Data got corrupted and the plist file was broken – not good!

The solution to this problem was to switch to UIDocument for file operations. But how to do it right? I asked this question myself and found a very very good tutorial from Kevin Hunter from Silver Bay Technologies on how to implement UIDocument for your file operations. And the best thing of all – the tutorial also covers unit tests and test driven development (TDD)! After working through it my document knows when loading data is done, when it has unsaved data and when the data is saved – the data management in Stepr is very robust now…awesome!

Because of this tutorial I was able to solve my problem for Stepr, learnt a lot about TDD and had also some knowledge on how to develop a mechanism to migrate from the old plist file to the new UIDocument powered file with unit tests and all the nice stuff.

I just can highly recommend to read this tutorial, it’s one of the best I’ve found so far! (Link)

Macintosh turns 30!

Today in 1984 the original Macintosh was released! This was one year before I was born. Incredible what happened since then.

Apple made a very nice web site according to the anniversary, have a look: http://www.apple.com/30-years/

Also you can download a font where the characters are all Macintosh desktops and notebooks made until today (via osxdaily)

font