Hello I'm Matt and I would like to make a formal apology to anyone to whom I have insulted Interface Builder. If you're interested in the story of how I got to this apology then let's take you way back to where my life with iOS development began.
Whilst studying my A levels I bought a book about iOS 3 to to try and teach myself app development. The book was a huge mistake as it went on the basis that you understood C, Interface Builder and it spent way too much time making you write out pragma marks which were never explained and somehow seemed very very important. I tossed the book in a corner and gave up my dream of making an app.
I joined my current job as an iOS Developer with very little experience. In fact, I actually ended up in the job because I went on an iOS Course that a guy at my current place ran as a recruitment drive and I basically begged my way into the class and then sat behind asking questions afterwards every time.
Everything at Cube is currently done programatically, and that makes sense to me. The guy who taught me iOS started iOS back in 2007 and I get the impression IB wasn't so great back then. Without interface builder it's easy for someone who is used to coding to see what's going on and understand the flow of an app. The code is right in front of your face and you can just change a number and know what's going to happen. Back when I started learning iOS, Interface Builder seemed clunky and like it was obfuscating pieces of the UI and configuration. I also noticed that as a new developer there were a lot of switches and fields available that I didn't understand.
I went to WWDC and along the way made friends with a handful of lovely developers. One of those lovely developers was James Frost and as I stood explaining to him how one of our cool new libraries work I think he went a little pale when I said we did everything programatically and didn't use IB or Auto Layout. I doubted myself for a moment but I stuck to my guns that Interface Builder was evil and carried on with my life.
James and I have had various conversations about Interface Builder over the past year and with the introduction of size classes, watchOS (Which is IB only) and now split screen apps for iPad in iOS 9, I slowly convinced myself that it was time to bring myself and work on board with Interface Builder. I knew that James was doing a talk on Auto Layout at iOSDevUK this year so I got tickets for the team and waited patiently.
Okay I didn't really wait patiently, I actually got pretty impatient and a few days ago I chose a relatively simple view to implement using Interface Builder in one of our apps at work and gave it a stab. There was some success apart from a handful of constraint warnings in the console. James then very kindly did a little tutorial for me on how he would build the same view and I learnt about 100 lessons about features of interface builder in 2 and a half minutes. I didn't even know about the preview window with all the different size devices. How embarrassing.
Today I took on the task of replacing one of our existing table view cells with a nib file and I've come out the other end of that successful too which is a relief. I'm starting to get the hang of this stuff.
I can actually see now how Interface Builder can save you time. You can preview all the different screen sizes without running the simulator and these days you can make custom views IBDesignable and save so much time configuring them. How many times have I compiled and run an app just to modify the corner radius of a view and check it looks okay? Too many.
Myself and the iOS team at work have wasted many a day working out how to get things sizing properly, especially on that darned iPhone 4(S) (Y U still support, Apple?).
Count me in
So I'm ready to get on board. Unfortunately we use various static libraries like ThunderTable at work to do what we do and it seems that you can't include .xib files in static libraries and then load them cross library. That's okay because we're moving to dynamic frameworks with iOS 8/9 (Praise the lord). It's going to take us a long time but little by little our views will move to interface builder and our lives will get easier. At first it will probably be harder, but we can deal with that.
So I'm sorry
I'm sorry for all the times I turned my nose up at interface builder, at Auto Layout and at those who used it. You were right and I was wrong. I think I probably wasn't always wrong in my justification, but certainly these days interface builder and Auto Layout are the right choice for me and the team at 3 SIDED CUBE.
See you on the other side.
Side note: I am aware that I wrote "Appology" and not "Apology" in the title. It's a joke. App-ology, get it? Oh god, that's awful isn't it? I'm sorry about that too