Stupid AppCode Tricks

You’ve probably heard in the past that the JetBrains guys built an Objective-C IDE called AppCode that competes directly with Xcode. I haven’t spent much time with AppCode since it’s release after most of the people I follow in the iOS community spent their time complaining about the lack of a native user Mac experience the IDE offers. If you can get past turning your nose at things that you don’t like what you’re used to there are some pretty neat things that AppCode does that Xcode only dreams of at present.

Remove Unused Imports

On either a project-wide or file-by-file basis AppCode can remove unused imports calls from your project.

  1. Open your Xcode project in AppCode.
  2. Select one of your files.
  3. Go to the “Code” menu and select “Optimize Imports”.
  4. A dialog will pop-up asking if you want to run the process on the single open file, or project-wide.

Once it completes any import that isn’t being used in that file is removed.

Show Dead Code

Features come and go. Deleting code is fun. But sometimes I forget to delete helper methods and other snippets of code from app versions past. AppCode conveniently will highlight these methods in gray (unless you’ve changed your colors). If you come across some dead code, delete it and move along.

Auto Import

I am pretty sure that Xcode is the only IDE that doesn’t have this feature at this point. If you’re in AppCode and start typing out a class name that is in your project, but not currently imported in the open file AppCode will offer to add the #import statement to the top of the file for you. What a novel idea!

Quickly View Method Implementations

If you are looking at a header file and see a method declaration you want to inspect, there is a pair of green and red arrows in the gutter of the editor that you can click on to go straight to the implementation. Way quicker than switching files and using manually searching for the file or using the Xcode pull-down menu with the methods listings.

View TODO Items Easily

I tend to litter // TODO comments throughout my source files to remind me of things I still need to implement during a larger coding project, or just to remind me to fix things that work but not as well as I’d like. In Xcode I treat these as warnings using a Run Shell Script build process that iterates through each of my files and generates a warning.

AppCode has a dedicated TODO section along the bottom of the main window. If you click on “TODO” it will show a listing of each file that has a TODO message inside of it and let you browse them.

I am not using AppCode as my full-time development environment, but it has proved to be an interesting utility to put in the toolbelt and to test legacy code bases against. There are a lot of interesting ideas in it that make me want to explore it even more in the coming weeks and months.

Ultimately, I don’t think AppCode is something that is targeted at the all-in Mac and iOS developers who would take the time to tweet or write about how ugly the app is. JetBrains has millions of customers already using their IDEs for Java development. Getting into iOS just got way easier for them.

About Justin

Justin Williams is the Crew Chief of Second Gear. He writes about consumer technology, running a bootstrapped software business, and more from Denver, Colorado.

Follow @justin on Twitter or get new articles via @carpeaqua.