Greetings and salutations, NSHipsters!
As the year winds down, it's a tradition here at NSHipster to ask you, dear readers, to offer up your favorite tricks and tips from the past year as gifts to your fellow hipsters. With iOS 9, El Capitan, brand new watch- and tvOS's, and the open-sourcing of some minor Apple-related tech, there's bound to be lots to share.
Submit your favorite piece of Swift or @objc
trivia, helpful hints, unexpected discoveries, useful workarounds, useless fascinations, or anything else you found cool this year. Just comment below!
If you need inspiration, try the list from last year, or from the year before, or from the year before that.
새해 복 많이 받으세요! 🎆
With the excellent addition of
defer
to Swift we Objective-C holdouts can't help but feel envious of the improvements happening so rapidly to the Swift language. Until Apple officially adds@defer
devs can actually implementdefer
support simply enough with a macro in Objective-C. Below I’ve outlined how one can go about doing adefer
today in Objective-C. Personally, having Apple add@defer
seem like an easy win for Objective-C, but we'll see what happens :) http://openradar.appspot.com/radar?id=6105823419826176I've been using my custom defer macro in production code since June and it is really the Bee's Knees!