App Store Cleanup is Nice, but App Store Search is Still Broken

Update (10 December 2016): Three months after I originally posted this article, and one month after “old” apps would be forced to update by Apple, there is only a single change—the removal of Elixr. However, it seems the creator, Mobelux, pulled this app from the Google Play store as well, indicating that the Apple clean-up had nothing to do with it.

Apple recently announced that they would be cleaning up the App Store. This is a long-awaited move that should help resolve one of my gripes about App Store. While this clean up is nice, it’s only the first step in fixing App Store search. I thought I would document a search I routinely run to discover new apps for Untappd (or, perhaps more honestly, to gauge the popularity of Tappd That). This cleanup process should remove a number of the top 25 results, but only a handful are actually relevant to the search term in the first place.

Apple Watch Complication Truncation

Tappd That ships an Apple Watch complication showing how many distinct beers you’ve consumed, along with a ring indicating how close you are to receiving your next distinct beer badge from Untappd. I recently ran into an appearance bug showing these values with the ring where they would be truncated with an ellipse. Originally, I had code to show an image if the value was four digits or larger, but that wasn’t enough.

Shared Library Debugging under El Capitan

In my day job, I do a lot of debugging of apps that use libraries in non-standard locations. This has traditionally been performed by exporting DYLD_LIBRARY_PATH in your environment and then debugging your app as normal. 1 2 3 4 $ export DYLD_LIBRARY_PATH=/path/to/lib/dir # ... code $ lldb ./myapp (lldb) r myapp_arg1 myapp_arg2 Under El Capitan, dyld environment variables are purged when spawning processes, thanks to System Integrity Protection.

Cargo Cult App Store

Several months ago, Apple announced the new Apple TV, a long-awaited update for their TV puck. The new Apple TV finally allowed anyone to write apps for the device, which could be distributed through the App Store. Apple practically gave away prototype devices, and so I was quick to request one. I decided this would be a good opportunity to play around with Swift as well as to learn a new Apple SDK.

Identification Please — Introducing Twenty One

Two weeks ago, I went over to Dogfish Head’s website to check the availability of their 20th anniversary beer. Before I could do anything, a familiar dialog appeared over the content of the website, forcing me to input my date of birth. I’ve seen these _age gates_ (in the parlance of web developers) hundreds of times before, but it really bothered me this time. I was on my iPhone in an area with really bad data service, and having to type into the birthday field made the page zoom into crazy dimensions.

Untappd Knows Where You Live

Yesterday, Untappd rolled out version 2.3.7 of their app for iOS. There were a couple neat features added like “Check-in Alerts” and (unfortunately) a quarter-star rating system. One new feature caught my eye, the ability to go back to old check-ins and add a venue. But wait…how does Untappd know what venues you were near when you checked in? As it says on the knowledge base page, “When you check-in a beer and have enabled geolocation, your checkins are geotagged, just like your photos are Geotagged with Instagram.

Don't Block the (Text)Box

Sometimes the location where the user is trying to type on the screen is directly underneath where the on-screen keyboard will appear. Apple has provided a solution to this, but it doesn’t work out-of-the-box these days. With iOS 8 and custom keyboard extensions just around the corner, it’d be a good idea to take a look at how you prevent view obstruction in your apps. First things first, your text field should be within a UIScrollView.

International Date Formatting Gotchas

Any iOS developer can tell you that you should always be formatting dates with an NSDateFormatter object (or the underlying C equivalent strptime, if you’re extremely concerned about speed). In Tappd That, I constantly need to parse dates that come across the wire in the format “Thu, 09 Jan 2014 12:03:00 +0000”. This is trivial using an NSDateFormatter, since I can just refer to the Unicode Technical Standard #35, revision 25 to set a dateFormat of @“EEE, dd MMM yyyy HH:mm:ss Z”.

Retrieving Response Body via AFNetworking with an HTTP Error Status Code

I use AFNetworking as a convenience layer to the NSURLSession classes in most iOS apps that would traditionally have a non-trivial amounts of networking code. I tend to not like using much third-party code, but the way Mattt Thompson has structured AFNetworking and the great community backing the project have led me to make an exception. AFNetworking makes it trivial to interact with the now-common JSON and XML-based APIs right out of the box.

There are several schools of thought regarding transmitting error message via web APIs. Many APIs simply return an error HTTP status code (4XX, 5XX) in the header of the response. Others will return a successful status code, but the body of the response will contain an error message that the client must parse. Others, like Foursquare and Untappd, use a hybrid approach — an HTTP error status code is set in the header and the body contains a JSON object with the error message. In AFNetworking 1.x  (in the NSURLConnection classes), the NSError parameter of the failure block of AFHTTPClient convenience methods would report the body of the failed response in their userInfo property’s NSLocalizedRecoverySuggestionErrorKey key. This could be considered a bit of an abuse of NSError, but it worked well. As of 2.x (in the NSURLSession classes), this functionality was not implemented and there is no way out of the box to retrieve error messages sent from a web service via AFNetworking.