Monday, January 11, 2016

Taking back disk space from Xcode

I have 256 GB SSD in my Macbook Pro, I have no external disks, and no cloud storage other than a Dropbox's free tier. So I think it's fair to say that I'm not a data hoarder. I live my digital life, much like I live my real life, lean and light.

In the last few months I've been constantly hovering around ~8GB of available space, and more recently I've opened my Macbook to messages of "No available disk space". Considering that I dilligently manage my storage I've been a little confused as to why this is the case.

After digging around a little, I discovered that the ~/Library/Developer folder is weighing in at 35.75GB, thats 13% of my disk space!

Digging a little deeper, ~/Library/Developer/Xcode/iOS DeviceSupport/ contains the symbols for every iOS version that you've connected to your machine. If you are like me, and have been doing development for a while, you'll probably have a few, I had 12, going as far back as 7.1.2. They range in size from 600MB, all the way upto 3.36 GB. For my development needs I only need the last two versions; 9.2 & 8.4.1. Removing the unused symbols, as well some dervived data from some old projects helped me recover around 13GB.

If you've installed Xcode Betas you may have had the issue where you have duplicate simulators, sometimes even 3 copies. Each simulator is usually 1GB+ so removing excess ones can save you some additional space. On the advice of this stackoverflow post I installed the snapshot tool, which is part of the fastlane toolkit. It has a handy command called "reset_simulators" which will remove all the simulators, and recreate only the simulators for the current primary SDK you have installed.

The above tips helped me recover 22 GB just from Xcode.

Friday, November 13, 2015

My public key

I'm not quite sure why, but it's taken me a life time to setup encrypted email. Below is my Public key, email away.

Friday, October 24, 2014

Making a numeric/pin pad with NSLayoutConstraints

NSLayoutConstraints are awesome. But like many cocoa technologies (strangely, all the ones that I like) the learning curve is fairly steep.

The goals was simple, I wanted to make a Numeric pin pad that would center itself in it's container view, while ensuring that all the buttons remained square, and aligned .... Ok, maybe not so simple.

Personally I hate resorting to changing the constraint priority, as I feel that most of the time it's a sign that your approaching the problem incorrectly. You can see a gist of the constraints below, ultimately I found the trick was this gem "-(>=1)-". By placing this between the outermost views and then pinning these to the superview, they provide the layout with the flexibility to meet all of it's requirements without having to adjust the superview or simply "explode".

Lastly, if your wondering why i've adopted this strange grouping mechanism inside my loop, I wanted the subview index have a 1-1 mapping with the button number, with out having to resort to setting tags. This way in the button handers I can look up the index of the sender in the subview collection, and know which button it is.

Like 99% of cocoa code, it's not concise. Disfrutarlo!

Monday, July 07, 2014

Future by Design

As a child I loved popular science magazine. Mainly because I was busy designing the future of space propulsion. Hint, it used "controlled" nuclear explosions.

However I've felt that since the 90's we (as a society) have lost our wondering quest for the next generation society. Today I discovered an inventor/futurist named Jacque Fresco. He's been pumping out ideas since before the second world war, some of which I think are brilliant, he also has some interesting views on society, and why it works as it does.

Tuesday, February 11, 2014

Filing Corporation Tax: CT600

I've been running my own UK Private limited company for a few years now. Because I'm cheap, I do my taxes myself. Usually from a location that would be considered glamorous by UK standards. As such calling the support line isn't really an option.

In recent years I've had a number of issues downloading the CT600 form. If you want to file independently you have to do it via this form, there is no alternative. This of course creates an issue if your nearing the deadline, and can't access the form.

If you happen to be having issues I have a single tip for you. Private browsing mode. Works for me every time.

Happy Tax filling day.

Tuesday, January 07, 2014

2014: Feliz Nuevo Año

A Kite Surfer in Cabo de La Vela, Colombia
While I doubt 2014 will mean that I suddenly start posting on a regular basis. For my millions of readers, Happy New Year.

Saturday, December 21, 2013

What a difference 3 years makes

In October of 2010 I came up with the bright idea to move to Sevilla, Spain.
Everything I knew about the City came from combination of wikipedia, Wikitravel & Google Earth. I packed my bag and got on a plane.

The sun shone, the drink flowed, I loved it.

But sadly, after only 6 weeks I decided to come home after a death in my Family. After 5 months back in England I had had enough, and set off again. Final destination unknown. This time I didn't come back for over 2 years.

Fast forward to today, 3 years later. I'm about to (try to) move to Bogota, Colombia. The situation is different this time around. I'm older (yay), I've seen a lot more of the world, I've actually visited the city before, and more importantly I can buy an Ice cream without resorting to Chinese.

What a difference 3 years makes.