Joris Kluivers

I like to build software.

Require a Call to Super in Overwritten Methods

Learned about a useful LLVM feature recently, which I tweeted about yesterday:

When trying this out for the first time in one of my projects it immediately warned me about a potential bug, where I forgot to call super.

Code for My UIKonf Demos

Earlier this month I was in Berlin to present at the first edition of UIKonf. This turned out to be a really well organized conference with a lot of interesting technical iOS related talks.

The video of my talk on Bluetooth Smart in iOS and Mac apps will be posted online soon. However because the demos in my talk are not easily reproduced from video I published the code for the projects online.

Quartz Composer

This is a call to action for anyone with the ability to file radars. My goal is to send some kind of signal indicating there are still people out there that love Quartz Composer. Which in my opinion is an amazing tool, but unfortunately didn’t receive an update since 2011.

Hidden Shortcuts Through Gestures

As Gruber wrote last year; on iOS the highest priority is obviousness. While gestures are used more often in apps they are the opposite of obviousness. In most iOS software there is a default way of doing things using buttons. Gestures merely act as shortcuts for advanced users, and remain invisible to the regular user.

While I consider myself a power user I was pointed to two for me previously unknown shortcuts in apps I use regularly. Reason enough for a new blog post.

PARStore: A Key-Value Store Created With Syncing in Mind

Last week at NSConf 5 my colleague Charles Parnot presented a 15 minute blitz talk titled Rethinking Syncing. In this talk he details PARStore: a key value store designed to work on top of syncing mechanisms like iCloud and DropBox.

To make syncing as transparent as possible this store’s functionality is kept as limited as possible. It is definitely not a fits all solution but works well in our use-case.

Custom View Controller Transitions Using UIStoryboardSegue

In this post I’ll show how to create a custom segue that animates an image to a new full screen view controller when tapped. This effect is similar to what you see when the Facebook iOS app makes a photo fullscreen.

Segues make it easy to abstract view controller transitions into reusable objects. Instead of having all the animation logic in your view controller the segue is now responsible for that. The view controller its role is reduced to configuring the segue and view controllers involved in the transition.

When done right this usually results in cleaner and more reusable code.

NIB Based Table View Cells

With the introduction of Storyboards for iOS and view based table views on OS X it is now possible to fully design table views in Interface Builder. Tables hold one or more prototype views which are returned by your delegate method based on a given identifier.

However designing these prototype views is less than ideal. Editing a small area nested within a table view easily leads to mistakes (and broken auto layout constraints).

Thats why I prefer to have each of my cells in individual NIB files. With the added advantage of being able to reuse the cells between different tables. In this post I take a look at the ways to load table view cells from NIB files, on both OS X and iOS.

Instancetype

The always informational NSHipster points out a new addition to Objective-C in LLVM: instancetype.

Use this type as the return type of a method and the compiler knows the returned object will be similar in type to the class defining the method. This is also know as a related result type.

CALayer Based Button Styling

Hackernews recently had a link on its homepage to an article comparing different ways to customize UIButton. One of the customizations used CALayers to change the look of the button.

Using CALayer is my favourite way to implement UIs. However the implementation in the article was a bit odd, and possibly educating readers wrongly. To show a correct implementation I submitted a pull request with three improvements:

  • Since there was no Quartz drawing going on I removed the use of drawRect:. Layers are initialized in the init... methods.
  • Using inherited methods from UIControl instead of doing event handling by hand.
  • Disabled implicit layer animations to be more in line with the other implementations that didn’t have animations either.

See the diff with my changes of the accepted pull request for more details. The article has also been updated since to reflect my suggested changes.