Refactoring

Brent Simmons response to Daniel Jalkut's refactoring of his network classes resonated pretty well with me. I like to write abstractions on default system API's, but not in the form of subclasses (save for UIKit classes like UIView, UIViewController), but generally in the form of a plain-old NSObject subclass that then uses the system API/Framework. This has the advantage of making it easier to compose libraries, and decoupling the implementation from the interface. For example, in Brent's example of an RSS Reader I would probably have a RKTFeedDownloader that…

Keep reading

New Blog

I decided to move my blog from Jekyll and GitHub Pages to Ghost. Having to deal with git to publish posts was stopping me from ever posting shorter posts - especially while on the go. The Ghost MarkDown editor is really nice. I'm looking forward to using it.…

Keep reading

Observables in Swift

As you may know, in Swift you cannot perform typical Key-Value Observing on non-NSObject subclasses. Whilst this may be an annoyance for people who make use of KVO on a regular basis, it isn't necessarily a bad thing, KVO is hard and lots of people get it wrong. Type generic classes and structs in Swift make it pretty trivial to create our own simplistic implementation of Observables, and we get the added benefit of them being opt-in and self documenting. I put a simple example of Observables together here: Gist.…

Keep reading

Objective-C Style Guide

Recently, I decided to have a formalise my Objective-C style-guide, to both help others who may be looking to write better Objective-C, or to improve my own if people provide feedback upon it. You can see it here. If you have any comments, send me a tweet @dantoml or leave a comment on the gist. Thanks!…

Keep reading

Bullying

It’s only now, as I prepare to leave the place where I grew up, to start my next adventure in life, that I feel I can share my past with the world. My hope is that someone like me comes across this, and they know that they are not alone. They will never be alone. And there is always a positive way out. I was always different as a kid. I'd rather have my head in a book, or be building cities with legos or taking apart all my…

Keep reading