QBlocker

QBlocker

A few months ago I switched from Chrome to Safari as my main browser. I enjoy using Safari to Chrome in almost every way but there was one feature of Chrome that I missed. There's an option you can enable in Chrome that will force you to hold CMD + Q to quite the app. As some who uses CMD + W to quit windows or tabs frequently, I often found myself accidentally quitting Safari. Solutions There are of course a number of solutions to the problem. Stop being such a sausage-fingered idiot and learn the difference between the Q and W…

Easy Form Validation in Swift

I come from a very web-centric background and have used frameworks like Laravel in the past extensively. One of the things I really loved about that framework in particular was the way in which it handled validation. If you don't know, Laravel just takes an associative array (think: dictionary) of field names and a set of rules. I looked for a similar class or package to do the same in Swift but couldn't find anything so I wrote something to do it. SRFormValidator If you can't be fucked to read the rest of the post and want to get straight…

Swift "AnyClass" Type

TL;DR you're looking for MyClass.self When working with ConnectSDK, I came across something I hadn't before in Swift: the AnyClass type. ConnectSDK is an Objective-C based library so I'd imagine this is a rarity when working with native Swift code. Here's what it looks like: discoveryManager?.registerDeviceService(deviceClass: AnyClass!, withDiscovery: AnyClass!) I mistakenly though it was looking for an instance (i.e. MyClass()) but that threw an error. It turns out that in Objective-C each class has the static class property. In the case of ConnectSDK it's looking for the following: [AirPlayService class] [DIALService class] [CastService class] This…

Customising Xcode

Customising Xcode

I've been using Xcode more and more lately after picking up a couple of iOS and OS X apps. For some reason though, it took me until yesterday to finally get around to customising the thing. 1. Alcatraz - Xcode's missing package manager Every decent text editor I've used (read: Sublime Text, Atom) has had a good package manager to go with it — be it third party or native — and Xcode is no exception. Alcatraz is an easy to install Xcode plugin that allows for quick install of plugins, themes and templates. Installing it is a simple as running a…