Wednesday, May 27, 2015

One of Them, One of Those, or Nothing in Swift

This is a simple data structure in swift which will store one of these -- an NSObject -- one of those (a String) or nothing at all (nil).

Tuesday, March 3, 2015

DRTabBarController: UITabBarController Replacement

If you've ever tried to put a UITabBarController inside a UINavigationController, you've run into trouble. DRTabBarController is a drop-in UITabBarController replacement that fixes this issue.

Tuesday, February 17, 2015

GameLoop in Swift

I never realized that you're not supposed to use NSTimer because it doesn't line up with the frame rate. Who knew? Anyway, here's my GameLoop class (Swift). Note: it has to extend NSObject otherwise you get weird selector-not-found errors.

Friday, January 23, 2015

Sizing Subview to Superview Using Autolayout with VFL and Cartography Using Swift

In talking with the Lead Developer of Mitosynth, I got inspired to get deep into Swift, Autolayout, and Cartography. And in the last 24 hours, I've been tearing my hair out with Autolayout in Cocoa using Swift. I finally got it down to a single question on Stackoverflow.

The answer to that question opened my eyes: Cocoa was "automatically adding constraints!" So without further ado, here are all my concepts wrapped up in one. This example uses Autolayout, VFL (using a nice category I made for Swift), and Cartography, too. Whoot!

VFL, Autolayout in Swift

I don't really understand this Visual Format Language (VFL_ stuff, and it rarely does what I want, but if you read the Apple page on it you'll get the idea. Anyway, here's an extension to use them in Swift. Substitute UIView for NSView if you're working on iOS Here is is on SO: link

Wednesday, January 21, 2015

My System: Workflowy for GTD

I can no longer fight it. I use Workflowy for everything. Using an external app for my todo list is just silly (though Wunderlist is awesome). So... here it is:

Never have a task list. Use tags and build out your world wherever you are.
  • Every Node is #project or #task or maybe a #superproject
    • Everything else is somewhere above, below, or in-between. So most of your Workflowy tree is not seen in the searches below
    • In GTD talk, a project is a series of actions needed to produce an outcome
    • In GTD talk, a task is something you can do...
      • Ramble:
        • This could contain other subtasks
        • But these are the things that a project is going to use to represent itself on the big todo list
  • Statuses
    • #next
      Last step before Complete
    • #waiting
      Waiting for an external event or person
    • #reminder
      In some external system like Reminders
  • Priorities get set by number of asterisks, consecutively, so highest is *****
  • Notes
    • Searches
      All the searches (vary the number of asterisks by deleting with backspace)
      • #task #next *****
      • #task #reminder *****
        Tasks in a reminder system elsewhere
      • #task #waiting *****
      • #task -#waiting -#next -#reminder ******
        Non-queued tasks for moving to Next or Later
      • #project *****
    • This way stuff goes from next to completed