Joris Kluivers

I like to build software.

HomeKit

At WWDC last summer Apple introduced HomeKit, the iOS 8 framework to communicate with connected devices in your home. Unfortunately half a year later asking Siri to turn off my lights doesn’t have the desired effect yet.

So far there is no actual hardware available with HomeKit support. However this is about to change quickly.

Tracking AppleScript Progress in Yosemite

The Yosemity update for OS X brings several advances in OS automation. A few people have written about this already, and as usual Michael Tsai provides a nice overview.

New in AppleScript is the ability to report progress. This enables the Finder or other UI in Yosemity to show progress indicators while your script is running.

1
2
3
4
5
6
7
8
set n to 10

set progress total steps to n

repeat with i from 1 to n
  delay 1
  set progress completed steps to i
end repeat

Script editor will run this script and show it’s progress at the same time:

Findings UI Design Iterations

Last week Findings was launched, it is a new app to manage your experiments in the lab. I’ve been working on this together with Charles Parnot for the past 1.5 years and I’m very happy the Mac version is finally available. The iOS version is still in development and will be available later this year.

On his weblog Charles writes about the Making of Findings. The original mockups are dated 5 years ago already and it’s interesting to see how the interface evolved over the years.

LLVM Unrecognized Command Line Options

The LLVM compiler in Xcode 5.1 now treats unrecognized compiler options as errors by default. Building Python or Ruby modules using unrecognized flags will now cause the build to fail.

I ran into this when trying to build lxml for Python recently. This failed with the following error message:

 clang: error: unknown argument: '-mno-fused-madd'

Google or stackoverflow provided no answer to this problem.

The Builder Pattern in Objective-C Foundation

In a recent blog post Klaas Pieter Annema wrote about using the builder pattern in Objective-C. Inspired by his post I created two categories that bring similar functionality to NSURL and NSDate.

An example:

1
2
3
4
5
NSURL *url = [NSURL URLWithBuilderBlock:^(NSURLComponents *builder) {
  builder.scheme = @"http";
  builder.host = @"joris.kluivers.nl";
  builder.path = @"/blog/2014/04/08/the-builder-pattern-in-objective-c/";
}];

My builder categories on NSDate and NSURL are available on github for review. Let me know what you think.

Generating Constants for Storyboard Identifiers

After I mistyped yet another segue identifier string this week my application once again suffered from a familiar crash:

Receiver (<JBWMasterViewController: 0x8cbd540>) has no segue with identifier 'showDetial'

You have probably seen a similar crash yourself, caused by a call to -[UIViewController performSegueWithIdentifier:sender:] with an unknown identifier. To prevent having hard-coded strings repeated all over the place I was already using constants to refer to my identifiers. However maintaining these constants manually is still prone to errors such as small typo’s. As demonstrated by my crash mentioned above.

To finally rule out crashes like this from now on my projects use a small python script to generate NSString constants for all identifiers found in UIStoryboard files.

Model Identifiers

Some statistics data I recently worked with included model identifiers for Apple devices. These identifiers are strings like iPad2,1 or MacBookPro10,2 and indicate what device variant and generation the software was used on.

The raw identifier is not something you usually display in a user interface directly, instead you show a more friendlier name. Unfortunately a way to translate iPad2,1 to iPad 2 (Wifi) is not readily available.

For that reason I created my own collection of iOS and Mac device model identifiers.

NSURLComponents

Along with the new URL loading classes (NSURLSession & family) iOS 7 and Mavericks also bring a new way of constructing URLs. Similar to what NSDateComponents provides for a NSDate we can now use NSURLComponents to inspect, build and modify NSURLs.

Playing With iBeacon and Estimote in iOS 7

My Estimote Developer Preview kit arrived this week. The kit contains 3 small devices that broadcast a signal over Bluetooth LE, to be used for proximity detection. Most interesting is that the devices are compatible with iBeacon, the new microlocation & proxity feature in iOS 7.

Estimote Developer Preview Kit

My Current Side Projects

Like many developers I like working on my own side projects next to my usual daily activities. This gives me some distraction and also the opportunity to use new technologies I would’t use normally.

However the number of projects I started and never finished is growing. Sometimes I get bored with a project or even forget about it and just start something new. Inspired by Matt Swanson I decided to publish the list of my current projects.

Focus is a matter of deciding what things you’re not going to do.
- John Carmack

By keeping track of my projects here I hope to shorten the list eventually. Preferably by launching a finished version to the public, or to cancel the project all together. This also means I’ll try not to start new projects anymore and instead focus on any of the existing projects.