The Daily Spin

Well it’s been a while since I updated this blog, and a lot has happened since.

I’ve moved away from hardcore dev and back into the marketing world. However, I’m focused on technical marketing, including data analytics, so I get to use Python quite a bit now.

One thing that hasn’t changed is my passion for cycling. I’m still regularly pumping out 250km+ per week, and loving every minute of it.

Read more

Vapor - Swift Web Framework

swift vapor web framework

I’ve been keeping an eye out for projects looking to develop robust web frameworks in open source Swift.

A week or so ago I stumbled on the very promising Vapor - a Laravel inspired web framework written in Swift. Check it out and star the repo.

You can build a basic Vapor web app really easily using this installer I wrote over the weekend.

Download the binary from the repo, add it to your $PATH enter vapor new ProjectName at the command line (OSX or Linux) and there you have it - a blazingly fast Swift web app.

Happy coding.

Matt

Read more

Perfect Server, Swift and Ubuntu with Vagrant

The open sourcing of Swift was a truly wonderful thing!

I’m really excited about the prospect of using Swift server side as it’s such a fun language to code in.

So, over the Christmas-New Year holidays I spent some time playing around with the very promising Perfect server on Ubuntu using Vagrant.

I’ve published this Vagrantfile for anyone who wants to play with a functional Swift webserver on Linux. :)

Happy coding!

Matt

Read more

UIViewController Extension to create a global UIActivityIndicatorView

You shouldn’t repeat code, so don’t!

One of the many things iOS developers need to do over and over again is to display a UIActivityIndicatorView in a UIViewController. However, most of the time this seems to be accomplished by adding a UIActivityIndicatorView to each controller, which does not adhere to the DRY principle.

Thankfully, using Swift extensions, it is very easy to create a global activity indicator.

Read more

Convert Dictionary Keys from snake_case to camelCase in Swift 2

RESTful APIs often return json dictionaries with keys formatted using snake_case, particularly for back-ends build in Ruby or Python frameworks. However, Swift typically uses the camelCase convention for object properties, which can make converting json responses to Swift objects a little too verbose.

Never fear, with a few quick extensions you can make this conversion a breeze.

Read more