Do try and catch my errors in Swift 2

This is bugging me, I keep forgetting it, I’m noting it down.

Swift 2 has changed error handling, just as I was wrapping my head around error handling in Swift 1. Typicals.

The easiest thing to do is wherever you see a method which ends with error e.g.:

audioRecorder = AVAudioRecorder(URL: soundFileURL, settings: recordSettings as [NSObject : AnyObject], error: &error)

This will kick in an error from the debugger. Bugger. Solve it by wrapping the method in a do block and catch the error after the block so the above becomes:

audioRecorder = try AVAudioRecorder(URL: soundFileURL, settings: recordSettings as [NSObject : AnyObject])
} catch let error as NSError {
  print("Error: \(error.domain)")

This StackOverflow answer set me straight on my errors with error handling and allowed me to retain a greater amount of my hair in the process . As always, praise be to the digital gods for StackOverflow.

Sandwich emails

Every week I amuse myself by conversion testing the weekly sandwich email at work using the very un-scientific method of testing whatever.

A few insights I have gleaned over time:

  • Short emails with just the words “order now” work less well than an email with a joke in there.
  • Emails sent closer to lunch (either side) convert less than emails sent at 4pm when everyone is feeling hungry again.
  • Telling people they are going to die from eating red meat or talking about the horrible deaths of animals has no effect on conversions.
  • emails tied to events like staff parties or worldwide events such as the world cup convert better than those that are not.
  • Subject lines make little difference unless you completely obscure the fact that this is the weekly sandwich email then conversion drops
  • More people like bacon than sausage. Not an innuendo, just a fact.

This week was my magnum opus, I went full-on Woot-style with a bit of long form copy. I’d be a fool to try and top this and so I won’t, I’m running out of ideas anyways:

As some of you may be aware, young Arron suffered a terrible injury to his leg on Tuesday when Mickey proper booted his legs in during some sort of organised ball kicking game.

Being a great friend I went to LGI last night to visit him. As I got there he’d just woken from surgery, flanked as he was by his girlfriend, doctors & porters. I could hear the kerfuffle from down the hall.
“what’s going on?” I asked as I approached
“We had to take the leg” the Doctor told me
“You had to take the leg?”
“We had to take the leg”, the doctor repeated “This poor lad had a severe deficiency of essential nutrients, it looks like he hadn’t been eating enough red meats which provide the necessary proteins and amino acids the body needs to rebuild itself after a trauma like this”
“Christ” I said as I sat down “so, if he’d eaten more bacon sandwiches he’d still have both legs?”
“Exactly” he said, shaking his head “it’s an all too common story, but it never gets the press so no one knows about it”
“I understand” I said, sadness tinged my voice, “but why have you left the amputated leg beside him? Bit cruel innit?”
“New government policy I’m afraid: hate the poor, torture the sick. Bloody tory government”
I’d stopped listening, to cheer Arron up I’d picked up the leg and started swinging it around the room, making lightsaber noises as it swung.
Vaaaaaawom, Vaaaaaawom
Arron started to cry. “Why didn’t I just order more bacon sandwiches on Thursday?”
Vaaaaawom, Vaaaaawom
“Dunno” I said, “the choice was there. The impetuousness of youth I suppose”
Vaaaaawom, Vaaaaawom. His cries got louder, dunno why, maybe it was the pain.
“At least you’ve still got Syd” I said as I gestured over to his girlfriend. She was leaving with a young porter who was proudly still sporting a symmetrical set of limbs.
“Do you think it will grow back?” he asked me.
I put the leg down. The doctor and I just looked at each other. Who would break his little heart this time?
Dear reader (you’re still reading this? Do some work!), I think the moral of the story is fairly unambiguous here. Can you imagine yourself, lying there, knowing you didn’t order that bacon sandwich? Knowing if you had ordered a bacon sandwich everything would be perfect, everything would be okay and you’d be a little more healthy than you were on a Thursday?
Arron asked me to share this story with you so you don’t make the same mistake he did: order your hot sandwich now. In memory of Arron if nothing else.
Order now!!!!!!


Centrally aligned text

Because it’s bugging me:
Centrally aligned text shouldn’t be used for paragraphs, it’s a trend and because it looks better atheistically and is easier for responsive sites people are using it way too much, industry-wide.
Science of why, by cleverer people than me:
When should you use centrally aligned text? When the text you are setting is 2-3 lines in length, then it’s usually about as readable as justified text or produces about as much fatigue. Anymore than that and forget it. If you are setting that much text centrally, consider whether you need that text at all or whether that’s something that you can shake out of the design because no one is going to read it.
This acceptable use rule also comes with a big BUT, if you are designing a responsive site and it sets perfectly at 2-3 lines at desktop when that scales to mobile you will suddenly have 8-12 lines of copy, centrally aligned again. What to do? What to do? For me, left align at mobile level and centrally align when the line numbers are suitable again.
Example of this being dog shit? Sure, coming from a place that should know better. Saw the centrally aligned version on the Apple Store app, the left aligned version is from the web version. See how much easier that is to read left aligned?
Also line length and leading play a part here but not as much as that consistent starting position for the eye to read from.

Interesting statement by IAB – “We messed up”

Give it a read through when you get chance.
Their solution to the ad-blocking storm in a teacup* post release of iOS9 sounds like they want to move to a solution similar to ad network The Deck. I approve. Users would too if most of them had any conception of what was going on behind the scenes. Marketing on the web is just gross.
*saying that, I do now use an adblocker on iOS. The difference in page load time is ridiculous, especially on The Verge, but then again, I’ve pretty much given up on The Verge, the reporting has become sub-Gizmodo standard and reading through Nilay Patel’s screed on why the mobile web sucks followed by his crying about ad blockers being used on the site was pretty much sealed the deal. I hate it when good sites go bad.

Terminal commands I always forget

This ongoing list is more for me so I don’t have to keep searching for these, but if someone else ever finds this useful then I’ll feel like I did a little bit of good in the world for 5 minutes. Then I’ll go back to being my usual hideous self.

If you are new to terminal then the asterisks surrounding text should also be deleted when changing to your value

Regenerate ssh keys for when I get the REMOTE HOST IDENTIFICATION HAS CHANGED warning

ssh-keygen -R *hostname e.g.*

Remove a directory and all it’s siblings

sudo rm -r *folderName e.g. ~/folder or ~/"folder with spaces"*

Copy an image to an SD card

It’s easier just to link to this as it’s long, check on the raspberry pi site

Is being responsive and pleasing Google halting creativity?

The Next Web recently opined that the web has become a boring homogenised place. In terms of work, I tend to agree in some ways, and have done for a while, see:

But I genuinely don’t think being responsive or pleasing Google has anything to do with it though. It’s simply one thing: experiential experiences have migrated to apps. When mobile kicked in, the difference between what native could leverage against what the browser could do, combined with the all more pleasing UX of being silo-ed in an app, where all UI is relative to the content you are expressly viewing; it’s an altogether more pleasing experience for the user.

Add in things like load times over 3G (or worse Edge) for web when you have loads of assets to bring in for your page, a drainer for anyone. Compare this experience to an app where users are now pre-conditioned not to consider the download anymore, you set it off and it’s off. You do other things and come back. It’s not the same feeling as waiting for that page to load on a website, plus with all assets downloaded once on an app, it’s far less painful when you go back into the app, they feel more responsive as everything is already compiled together.

The entire web has been hacked for so long it’s forgotten what it should be. The web should be Wikipedia. We’ve stretched, contorted and abused it for so long to add in more api’s for video, for audio, for 3d graphic that it’s forgotten that it’s all about the HyperText in HTML. Strings and links.

What we are seeing now is the web settling back down to what it should be, what it should do. It’s the worlds biggest library, but most libraries don’t also have a cinema and a live gig simultaneously going off in them and most libraries certainly don’t spam me with massive ads, flashing their bullshit into my retinas constantly.

Apps are rightfully where the creativity is, the problem is there isn’t a Google search equivalent for apps and surfacing the right content can be a chore. When they nail that and app developers are as commonplace as web developers so that it’s a service that any old agency can implement for clients I think we will see nearly all marketing activity shuffled over to apps.

This won’t kill the Internet. All the content that exist today will still power all those apps. The Internet just serves information. The data in the databases which powers the HTML web can be just as easily sent to apps via JSON/XML/Whatever feeds. We just need to be offering the right type of content viewer for the right type of content for that particular audience.

Bye Flash

Thanks for all the bad times. I’m sure you’ll pop back up in a few conversations going forward, you’ve still got your old friends in IE users to watch the sun set with and I can still always find you online, gambling somewhere, I suppose.

It wasn’t all bad, sure, we had those wonderful times in the early 2000’s when I was young and impressed by your tweens but sure enough over time you just drained the life out of my laptop. We’ve both changed and grown in the following years and now I knock around with HTML and Swift and you apparently knock around with people wanting to spy on me and that ain’t cool.

So, just like I did Shockwave all those years ago, I’ve gotta let you go Flash.

God I miss Shockwave. That shiz was the bomb.

Thoughts on the IAB updating HTML5 display guidelines

Bring me up to speed on what you are talking about?

As per this article in The Drum:

The IAB have released a document for comments on new guidelines for HTML5 display advertising.

Why do I care?

Non-important Flash content will be paused in Chrome as of September. In our tests with the Chrome Beta, this generally means display ad content. Flash content already does not work on mobile/tablet devices, in their place  are banners created out of HTML, the same stuff webpages are made from. Flash banners are made out of this crusty crap from 15 years ago which while nearly ubiquitous across internet connected PC’s and Mac desktop devices also produce significant power usage issues and, more importantly, significant security issues. The industry will be moving to HTML5 banners as standard, which is a wonderful new thing for client services to sell in (dare I say it, maybe with a slightly higher margin??? I dream too much)

So what does this document say about the only thing I care about: permitted file sizes?

In a nutshell:

  • 200KB for the max initial file load size for standard desktop display creative sizes
  • 50KB for max initial file load size for standard mobile display creative sizes

This makes a huge difference to what we can deliver, how we deliver it and the timelines to delivery.

If you are still receiving old specs of 40kb for Flash you MUST to push back on this like a motherfudger. If you don’t push back on it I will be pushing you down the stairs whilst calling you a motherfudger.

Further to this Double-click announced in a blog post that they would be allowing “HTML5 ads by offering unlimited file sizes…for free” (, up from their previous creative file size of 1mb (

What does this mean for HTML 5 banners going forward?

There is still a lot of flux in this document (commenting closes 18 September) so things will change after this commenting period however the important thing is that we are still receiving ad specs from networks saying 40kb limit as you would for Flash. This is not acceptable. For example as per IAB documentation published prior to this new document (emphasis mine)

“HTML5 did not become an official recommendation until December 2012, nearly a year after the IAB Display Advertising Guidelines: The New 2012 Portfolio was released. As such file size limitations were not taken into account for ads developed using HTML5. Current file size limits for ads developed with Flash are sufficient because Flash files can be compiled, compressed, and packaged to accommodate smaller file sizes.

However HTML5 doesn’t have the compression and packaging capabilities and with high-density displays permeating the market, larger creative assets are necessary in HTML5 to produce crisp visuals.


(see section 2.2

40kb file sizes are unacceptable for HTML5 content, the IAB has made this clear… in 2013.

With Flash-ggeddon rapidly approaching this conversation is going to happen a lot. We have squandered an opportunity to be thought leaders in this arena a year ago when we first started discussing HTML5 banners internally due to both a lack of understanding and also a willingness to understand. What we do have is here is a greater opportunity here to better service clients and be seen as forward-thinking, thought leaders with a great understanding of the problem and solution to people outside of our industry whilst making lives easer for team members on both creative and client service teams.

Blow this opportunity and a set of stairs await you.

Wrap it up mate

This updated document from the IAB does not mean the end of the conversation or that implementation details for HTML5 display banners have been finalised by ourselves or by the greater industry. The conversation about what is creative’s remit and what is dev’s remit and what is the most efficient method of creation is ongoing. Best practice conversations are developing and ongoing. Technology and software conversations are ongoing. With all these headaches and heartaches to come having a coherent standing on the file size issue will be incredibly important.

Action before Information

I was just watching this video of a demo Tesla app and it made me realise something that I have been subconsciously thinking about since getting the Apple Watch. A big shift in thinking for these sort of apps should be giving the user access to actions before information. I feel far less friction about being given options to do things and then having to swipe to get information than I do when it’s information and then I get to my actions. In this context, menus can also be considered information.

More than that, I tend to use the Watch to do, rather than view. Quick access to functionality is key.