Monday, August 21, 2017

Moving from Blogger to Postachio

Discovering StackEdit has been absolutely brilliant (and the confusing Beta of Classeur App, too, but I’m moving to my blogging to Postachio for now.

Please check me out at my new location when you can.

Written with StackEdit.

Saturday, August 5, 2017

Color Syntax Highlighting for Code in Evernote

This solution doesn't give you dynamic code syntax highlighting, but it's pretty useful anyway. I use Evernote to avoid going insane as I work on many things at the same time.

Monday, May 8, 2017

Fast Stuff on a Background GCD Queue

I realize this is not a popular position, but the truth of the matter is that for many (most) situations, you can just do stuff on a background queue and then dispatch the main queue. It's pretty hard (but not impossible) to clog up the main dispatch queue.

NSTimer Replacement: Faster!

Here's my timer for running stuff in the background. Generally, this is all you need. Dispatch to main from within your callback as needed:


Get on Main Queue the Right Way

On the other hand, if you want to do this right and never risk clogging up the main queue, you need to use a dispatch source. See Rob's stuff here on SO, particularly the last part where he discusses a progressIndicator.

GameLoop for MainQueue Dispatch Tied to Frame Rate

On the other hand, if you want something to update every time the main loop goes around, you can use this Game Loop:

Monday, March 20, 2017

Locks with GCD and Swift 3

Even in a Playground it's easy to see how locks work. When useLocks is set to false, a fatal error is thrown before the counter even gets to 5! When it's set to true, the counter can get to its natural endpoint (200).

Saturday, March 18, 2017

Thursday, November 10, 2016