guard & defer
“We should do (as wise programmers aware of our limitations) our utmost best to … make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial...
View ArticleReader Submissions - New Year's 2016
With 2015 behind us and the new year begun, it’s time again for an NSHipster tradition: reader submissions! As inyear’spast, this installment is chock full of tips and tricks that can help ease your...
View ArticleUITextChecker
Make no mistake, a tiny keyboard on a slab of glass doesn’t always lend itself to perfect typing. Whether for accuracy or hilarity, anyone typing on an iOS device notices when autocorrect steps in to...
View ArticleNSHipster Quiz #8
This year’s WWDC edition of the NSHipster Pub Quiz was held on June 14th, once again testing the assembled developers with questions both random and obscure. We’re enormously grateful to Realm, who...
View ArticleNSRegularExpression
“Some people, when confronted with a problem, think ‘I know, I’ll use NSRegularExpression.’ Now they have three problems.”Regular expressions fill a controversial role in the programming world. Some...
View ArticleSwift GYB
The term “boilerplate” goes back to the early days of print media. Small regional newspapers had column inches to fill, but typically lacked the writing staff to make this happen, so many of them...
View ArticleBug Reporting
“File a radar.” It’s a familiar refrain for those of us developing on Apple platforms.It’s what you hear when you complain about a wandering UIKit component. It’s the response you get when you share...
View ArticlePassword Rules / UITextInputPasswordRules
It’s no wonder why hipsters obsess over artisanal this and handcrafted that. Whether it’s a thick slice of avocado toast, a bottle of small batch (nondairy) golden milk, or a perfect cup of pour-over...
View ArticleNever
“Never” is a proposition that an event doesn’t occur at any time in the past or future. It’s logical impossibility with a time axis; nothingness stretching out in all directions, forever.…which is why...
View ArticleNLLanguageRecognizer
One of my favorite activities, when I travel, is to listen to people as they pass and try to guess what language they’re speaking. I’d like to think that I’ve gotten pretty good at it over the years...
View ArticleHashable / Hasher
When you make a Genius Bar reservation at an Apple Store, you’re instructed to show up at a particular time of day and check in with the concierge. After directing you to pull up a stool, the concierge...
View ArticleSwift Property Observers
By the 1930’s, Rube Goldberg had become a household name, synonymous with the fantastically complicated and whimsical inventions depicted in comic strips like “Self-Operating Napkin.” Around the same...
View ArticleNSDataAsset
On the web, speed isn’t a luxury; it’s a matter of survival.User studies in recent years suggest that any perceivable latency in page load time — that is, greater than 400 milliseconds (literally in...
View ArticleCMMotionActivity
Humans perceive self-motion using a combination of sensory information from their visual, proprioceptive, and vestibular systems. Of these, the primary determination is made by the vestibular system,...
View ArticleiOS 12
If you tuned in to this year’s WWDC Keynote, you’ll know all about the big features in iOS 12: Siri Shortcuts, ARKit 2, and Core ML 2— not to mentioned the bombshell pre-announcement of the...
View ArticleUIFieldBehavior
The decade mark for iOS has come and gone. Once a nascent craft, iOS development today has a well-worn, broken-in feel to it.And yet, when I step outside my comfort zone of table views, labels,...
View ArticlemacOS Dynamic Desktop
Dark Mode is one of the most popular additions to macOS — especially among us developer types, who tend towards light-on-dark color themes in text editors and appreciate this new visual consistency...
View ArticleSwift Literals
In 1911, linguist Franz Boas observed that speakers of Eskimo–Aleut languages used different words to distinguish falling snowflakes from snow on the ground. By comparison, English speakers typically...
View ArticleNSDataDetector
Text means nothing without context.What gives weight to our words is their relation to one another, to ourselves, and to our location space-time.Consider endophoric expressions whose meaning depends on...
View ArticleCMDeviceMotion
Beneath the smooth glass of each iPhone an array of sensors sits nestled on the logic board, sending a steady stream of data to a motion coprocessor.The Core Motion framework makes it surprisingly easy...
View Article