How to Generate Beautiful Apple-Style Documentation in Xcode 5

Good code should be self-documenting, but sometimes you also need to generate external documentation for reference purposes. In this post I’ll show you how to use two open-source tools and a build script to create beautiful, Apple-style HTML documentation files in Xcode. I’ll also show you how to create docsets for Xcode so that your class references show up right along side Apple’s! It will be a seamless and dare I say, enjoyable, process for generating documentation.

Continue reading

How to Get Back the iOS 6 SDK After Upgrading to Xcode 5

iOS 7 finally launched on September 18, and with it, the public release of Xcode 5. However, after upgrading you will notice that you can no longer compile using the iOS 6.1 base SDK. This is a problem for any app that isn’t yet compatible with the iOS 7 SDK. To see what SDK’s you have installed, open the Terminal app on your Mac and enter:

ls /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

If you only see the iOS7 SDK folder listed, you will need to extract the iOS6 SDK folder from an old copy of Xcode 4.6. Or you can just download it here. Copy your extracted iPhoneOS6.1.sdk folder into the folder shown above. Shut down and restart Xcode. You will then be able to select from both SDK’s when building or running.

If you just need to download the iOS 6 simulator, open Xcode and go to Xcode > Preferences > Downloads.

Editable UITableViewController

UITableView

A common use case in iOS is creating a form or an editable list of records directly inside a UITableView. We could send the user to a separate “detail” view controller for editing, but that complicates and slows down the user experience. In this post, I’ll show you how to create your own subclass of UITableViewController that can support any number of UITextFields inside your table cells and use them to update any backing data source. This code can then be reused in any project that needs an editable table view!

Continue reading