What I Learned This Week 13/10/16

What I Learned This Week is a weekly blog of small dollops of info I remember from the previous 7 days. It covers a wide range of topics, often tech, but sometimes wrestling, beer and a random selection of other things too. Have anything to add, find me on Twitter

I Love Being Told Off

I’ve downloaded SwiftLint this week, as I’m still relatively new to Swift, I feel I’m falling into some bad habits. Some I’ve inherited from Obj-C, some are just through being unfamiliar with the language.
SwiftLint lights my code up like a Christmas tree to tell me all the little things I have wrong, to help improve my style, and code quality. Although it doesn’t look pretty right now, my ultimate aim is to give my code better readability for future use.

There’s no need to reloadData()

Instagram released IGListKit this week, they have hinted at it briefly in the past, but its great to be able to finally have look around.
IGListKit really feels like a modern version of collection views/tables on iOS.
On standard iOS collections, when the underlying data us updated, reloadData() needs to be called to refresh the whole table. While this is processed in a very efficient way, and hidden from the user as much as possible, sometimes this seems inefficient and a complex way of doing things.
IGListKit allows you to slide in new elements like Beyoncé sliding into my DMs, keeping the rest of the list just how it was, with no extra layout or initialisation code needed.

Shell Stress Relief

Blake Williams came up with this great shell alias to force quit a frozen application using the terminal that also helps remove the stress of a frozen app.
To quit, just type fucking {Application}. I would enable Siri on my Mac in a heartbeat if this command was available for Siri.
If you’d like to set this up, but you’re not too versed in terminal, there’s just a couple of steps.
In terminal, type nano .bash_profile
This loads a text editor, there may be some data here already, if so go to the last empty line, and add alias fucking="pkill -9 -f"
Press Ctrl+O, press enter, press Ctrl+X. Quit terminal. Next time you open, this command will be available to you.