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 Extensions in iOS, it is critical that frameworks that can be linked to both Extensions and Apps be cognizant of their uses so they don't call any APIs that might not be available to an Extension (like
UIApplication
). Here's a function to help determine if you are running in an extension at runtime:That frees you to do things like this: