Medium/variants — pull request #26 by andybons (2014-12-21 02:28:34+00:00)
Title: WIP: Variants iOS implementation

Happy Holidays Medium Team! :christmas_tree: I got you something shiny... that, uh, I need for my own stuff. I’m so selfless I know.

I say WIP because I’d like to start a discussion given that...
+ I don’t know Medium’s class prefixing rules, style guide (though I hope it’s compatible with clang-format), or documentation requirements for iOS.
+ I don’t know what to put at the top of files :). Right now it’s just the boilerplate that Xcode spews out.
+ I’ve resorted to raising exceptions in the cases where an error would be thrown in Node or returned in Go. I‘m not so sure that all cases qualify as being truly exceptional (is loading a badly formed JSON definition an exceptional condition?). No doubt that if they remain, that users would have to wrap the calls that load the config in try/catch blocks. Seems kinda gnarly to me, but consistency with Medium’s current iOS code trumps personal opinion on the matter.
+ The library is *not* threadsafe (in fact, neither is the Go version). It should be.
+ It currently requires the user to implement named registries.
+ A Podfile, README, and other loose ends need to be written once the above points are dealt with.

It would be great to get feedback on the API. Right now the code relies very heavily on runtime type checks and casting (perhaps unavoidably). Please include any other members of the iOS team as you see appropriate.

@kocodude @thedrick