99 [r]eddits v2.8.3 is now available

iTunesArtwork@2x copy_no_alpha.png

For the past month, I've been working on an updated version of 99 reddits for iOS with Aman. 99 reddits is a lightweight Reddit client that lets you quickly explore images and (some) animated GIFs from any subreddit. 

99 reddits was first launched back in 2012. Up to this point Aman had been updating the app 1-2 times per year with folks from Elance / oDesk and funding development with an In-App Purchase. Looking for a side project with real users and inspired by Artsy's Open by Default, I shot him a PR one day.  

Compared to other times I've worked on side projects, this release has been a real success. There are two things that made a big difference this time:

  • Trusted team > lonely developer. Aman and I have worked together for over 4 years at different companies and on different projects. I've learned a ton about product management from him. We know our working styles and know how to work well together. Putting together a release is no big deal because we've done it so many times before.
  • Having an audience! With zero marketing, 99 reddits had accumulated a couple thousand monthly active users. Writing software for an audience immediately raises the bar and creates a strong feedback loop.

GOTCHAS & Roadblocks

  • Because of trademark concerns brought up during app review, we had to change the name from the original "99 reddits" to "99 edits" and modify the app icon to hide Reddit alien. Unfortunately, this make the app harder to find, but this update is more for the devoted users that use 99 reddits regularly. 
  • ERROR ITMS-90101: "This bundle does not support one or more of the devices supported by the previous app version".  Did you know Apple doesn't let you drop iPad support once you make your app universal? As part of the update, we wanted to focus all of our attention on iPhone since an overwhelming majority of usage happens on iPhone. Once we found out we weren't allowed to drop iPad, I leaned heavily on UISplitViewController & trait collections to reuse code between iPhone and iPad.  I had to work around several UISplitViewController bugs around iOS 11 large titles and iPhone X layout.
  • Tech debt had piled up for 5 years. Working on this code base was like stepping through a time portal to a time when ASIHTTPRequest and NimbusKit were the latest hotness. My first instinct was to rip out, rewrite and replace. Here's where having a pro product manager was super helpful. Aman kept us focused on shipping, so we ended up with a good balance of product features and tech debt pay-down.

Release Notes

* Removed payment/upgrade stuff. The app is now totally free. Thanks to all who paid over the years, your support meant a lot!
* Improved cache management. 
* Many fixes, including crashing when saving a pic. 
* iPhone X and iOS 11 updates.
* New iPad layout.


For product questions and support, you can head over to the official 99 reddits subreddit. Found a bug? Feel free to open an issue on Github or submit a pull request if you're trained in the dark arts of Objective-C and preprocessor macros.

Radar: UIToolBar pinned to bottom of the safe area broken on iPhone X

Update 2017-12-04: "Engineering has determined that your bug report (35633289) is a duplicate of 34404165 and will be closed."


For the 99 reddits app, I updated the UI to respect the "safe area" in iOS 11. One of the view controllers made use of a UIToolBar, which doesn't look right on iOS 11 when I attach the bottom of the toolbar to the bottom of the safe area (see attached screenshot).

Filed as rdar://35633289 and on Open Radar

On an iPhone X, when you add a standalone UIToolBar to a view controller and add a constraint from the bottom of the UIToolBar to the bottom of the its view controller's safe area, the bar button items appear outside the UIToolBar. It works perfectly on an iPhone 8.

Steps to Reproduce:
1) In a storyboard file, add a UIToolbar to the initial view controller.
2) Add three constraints: trailing to the safe area's trailing edge, leading to the safe area's leading edge, and a constraint going from the bottom of the UIToolbar to the bottom of the view controller's safe area.
3) Build and run on an iPhone X.

Expected Results:
- The UIToolBar looks the same as if it had been the tool bar of a UIToolBarController.

Actual Results:
- The bar button items in the UIToolbar appear above and outside the enclosing toolbar.

iOS 11.1 (15B87)

- iPhone X

Screen Shot 2017-11-18 at 3.34.46 PM.png



Core Data by Tutorials (Fourth Edition) Now Available


I'm happy to announce that there's a new edition of Core Data by Tutorials available today, fully updated for iOS 11, Swift 4 and Xcode 9. How time flies! I still remember working on the original version of the book back in 2013 and it doesn't seem that long ago. That's the same year Apple announced Swift 1.0 at WWDC. It was a busy time getting up to speed on this new language and rewriting our Objective-C drafts.

Even among experienced iOS developers, Core Data is infamous for its learning curve and sharp edges. With newer options for persistence such as Realm and Firebase, I see a lot of iOS developers skip right past Core Data, ignoring the framework that ships with the SDK.

The truth is that Core Data offers a robust, free, solution that integrates nicely with all the native frameworks and tools you already use every day. No other solution integrates directly with UITableView, features a model editor built right into Xcode or plugs directly into Instruments. Plus you definitely know no one is going to acquire Core Data and shut it down. Book or no book, if you've never tried to use Core Data, I encourage you at least kick the tires a bit.

Many thanks to my co-authors Aaron Douglas, Saul Mora, and Matthew Morey. And special thanks to Ray Wenderlich for bringing us together and to the many editors and technical editors we've had throughout the years: Rich Turton, Greg Heo, Darren Ferguson, Sam Davies, Bradley Phillips, Brian Moakley and Chris Belanger.

Tools of the Trade for iOS Development

During the past few years of doing mobile development I’ve found a number of tools that have saved me time and frustration. This is by no means a comprehensive list of all the tools out there, but rather the small set that I’ve found helpful. They are also not all limited to iOS development. Some will be helpful on other mobile platforms or for general software development.

These posts usually group apps into different categories but I’m going to list them in (roughly) the order that I started using them.

1. Xcode

Duh, right? Like many before, my journey into iOS began when I downloaded Xcode for the first time. These days I like to code using Xcode’s built-in Midnight theme. I also have Alcatraz set up on my machine to manage my Xcode plugins. My favorite plugins are BBUDebuggerTuckAwayDerivedData Exterminator and SCXcodeSwitchExpander.

2. SourceTree

SourceTree is my favorite git client (although I’ve also experimented with Tower). It works really nicely with Github and Bitbucket.


JIRA is Atlassian’s bug tracking software. I don’t find JIRA very useful when I'm building something from scratch. To me, any kind of bug tracking software becomes a lot more useful once you have something out there to fix, maintain or improve.

4. Sublime Text

Sublime Text is my favorite general purpose text editor. Even though iOS developers work with native code most of the time, there are times when we have to roll up our sleeves and dive into some HTML or CSS. I’ve also found Sublime to be a good tool for JavaScript.

5. xScope

Designers hate it when your implementation looks nothing like their designs. Measuring pixel distances and aligning things in straight lines don’t come naturally to me so I use this little tool to help me implement UI designs to a high degree of fidelity. xScope includes tools such as rulers, overlays and guides.

6. Charles

Charles is my favorite HTTP/HTTPS debugging tool. It’s a proxy that intercepts all network requests coming in and out of your app. I’ve come to love its "Map Local" feature to simulate “what-if” scenarios with your API.

7. Base

Base is a lightweight SQLite browser. I started using this tool when I was first learning about Core Data since Core Data is often backed by SQLite. You can use Base to find out exactly what's saved on disk.

8. Linguan

Localizing an app to other languages by hand is no fun. To make matters worse, Xcode doesn’t provide a GUI to get the job done quickly. Linguan is the localization GUI Xcode should have had. This little tool has saved me hours of tedious manual labor.

9. Spark Inspector

Attach Spark Inspector to your running app and it will show you a 3D model of your view hierarchy. Spark is useful when you’re debugging your layout or your views. I also hear good things about Reveal, although I’ve never tried it.

10. Deploymate

When your app supports multiple versions of iOS, you have to be careful about backward compatibility issues. For example, if you use a new API that didn’t exist in an older version of iOS, your app will crash on older devices. Deploymate is a static analyzer tool that alerts you of this type of problem. I suggest using it before submitting a new version of your app to Apple.

11. Slender

You’re adding assets when you add new feature, but are you remembering to remove old assets when you remove old features? Probably not. Slender scans your project for assets that you no longer use so you can remove them.

12. Cocoapods

Cocoapods is the de facto dependency manager for iOS and Mac OS projects. If you want to add a third party library to your project, it’s as easy as adding a line of text to your Podfile and executing a terminal command. I can’t recommend it enough.

13. Crashlytics

Getting timely crash reports from users is essential to improving the quality of your applications. Crashlytics is one of many crash reporting tools available for iOS. I’ve also worked with Testflight, HockeyApp and Crittercism.

14. Kaleidoscope

Kaleidoscope is Black Pixel’s diffing tool. You can use it to compare text, images and directories but I mainly use it for comparing two different images. For example, I'll use Kaleidoscope to compare a mockup with a screenshot of my live UI. I then use this information to improve and iterate my UI implementations.

15. Simpholders

One of the advantages of running your app on the iOS simulator is that you can inspect your app's file system using Finder. This is practically impossible on a physical device. The problem is that the iOS simulator is buried somewhere in ~/Library and its location changes with every version of iOS (or so it seems). Simpholders is a shortcut to the simulator directories that you can access from the menu bar.

If you think I’ve left out an important tool, please go ahead and let me know in the comments. Each tool listed on this post has either increased my productivity or increased the overall quality of the apps I've worked on. I’m sure I’ll be adding more tools to the list as time goes on. Enjoy!

Core Data by Tutorials updated for Xcode 6.1

We’ve updated Core Data by Tutorials for Xcode 6.1. The update includes a number of small Swift changes and some fixes for errata that readers pointed out. Here’s the official announcement.

If you played with Swift while it was still in beta, you probably realized that your projects would stop compiling going from one Xcode beta to the next.

Even though Swift is technically not in beta anymore, moving from Xcode 6.0 to Xcode 6.1 was no different. We’re still in the (very) early days of Swift.

Core Data by Tutorials Now Available

Good news — Core Data by Tutorials launched yesterday in PDF format. The book is written in Swift and it covers everything from the fundamentals up to the new iOS 8 APIs. The whole process was a great team effort and I’m very happy that it’s finally out in the world.

Personally I prefer following a tutorial step by step rather than listening to a lecture or reading a book. I’ve always been a fan of learning by doing, especially if I’m starting from scratch.

Here’s a link to the announcement on Ray’s site. Also here’s a sneak preview of chapter 1 in blog post form. I hope you guys enjoy the book.

WWDC 2014: “A Strategy of Great Work”

I just finished watching a WWDC talk titled A Strategy of Great Work. It's a beautiful talk by Ken Kocienda, a software engineer who's worked at Apple for more than a decade.. He goes through 8 stories and 11 lessons that he learned during his tenure at Apple.

The last lesson is "you are never done". He ends with this quote from Steve Jobs:

If you do something and it turns out pretty good, then you should go do something else wonderful, not dwell on it too long. Just figure out what's next.

You accomplished something. Great. What's next? How are you going to top yourself next time? It reminds me of Elizabeth Gilbert's TED talk about her drive to keep creating. Two different fields, same idea.