Article summary
For a long time, the only IDE that iOS and OSX developers had was Xcode, and life was okay. Then JetBrains released AppCode. For the last 6 month, I’ve had the opportunity to use AppCode as my primary IDE, and it is head and shoulders above Xcode.
- Code Generation
- File Navigation
- ⌘⇧N – Find in all project files
- ⌘N – Find in all classes
- ⇧⇧ – Find in all project files and display list of recent files
- ⌘E – View a list of recent files
- Renaming Things
- Testing
Creating new classes in Xcode is the worst. When I’m in the middle of writing a test, the last thing I want to do is lose my train of thought. Since we practice TDD at Atomic, often times I’m writing tests using classes that don’t exist yet or are not yet imported. When I need to create that class in Xcode (to get the tests to compile) I have to find the folder I’d like to add that class to, right click, new file, yadda yadda. Then when I settle on a good method name for that new object, I have to go to the header, declare it, and then stub out the implementation. Finally, I’m ready to navigate to the top of my current file and add the #import "filename"
.
AppCode takes away all of that pain. When I’m in the middle of a unit test and I need a new class, I simply declare that class and hit ⌥⏎ and specify where to place it. I can then define new methods on that class by hitting ⌥⏎ again. AppCode even brings up a modal allowing you to change that method’s signature and add or remove parameters. When I’m using a class that already exists but I haven’t imported yet, I can use ⌥⏎ again to add that class to my imports.
Xcode file navigation is not awful. You can fuzzy find files using ⌘⇧O, and it works pretty well, but AppCode does it so much better.
AppCode provides several different file finders:
Another Xcode oddity that bugs me is that when I rename a file, the class name remains unchanged. If I want to then rename the class, I have to right-click the class name, choose refactor, and then rename it. Also, refactoring methods to add or remove parameters is completely a manual process in Xcode. I have to navigate to the file I want to change, and manually add the parameter.
In AppCode, I can click a file and hit ⇧F6 and voilá, I’m editing the file name and the class name. If I need to add a new parameter to a method, I can hit ⌘F6 anywhere that method is used in the code to bring up a modal that allows me to add a new parameter. When I update the method, all calls of that method are updated with the new parameter (defaulted to passing NULL or 0).
The only way I’ve found to run a single test in Xcode is to click the tiniest of icons in the breakpoint space of a test file. Of course Xcode has shortcuts for running all of the tests, and usually it doesn’t take too long to run those tests. However, I don’t really care about the other 900 or so other unit tests in my application when I’m writing a new one.
In AppCode I can at least narrow it down to only running all of the tests in the current file using ⌃⇧F10.
When I Still Use Xcode
There are a few things that I still need Xcode for. Firstly, anything to do with core data must still be done in Xcode. I also still use Xcode for any storyboard work. As of AppCode 3, storyboard editing is possible, but I haven’t made the switch to AppCode for my storyboarding needs. Lastly, I still need Xcode to archive applications.
Let me know why you prefer AppCode over Xcode or vice versa.
Another great feature of AppCode is the support for CocoaPods :)
In general just the refactoring support (specially extracting methods/variables/properties etc) is already worth to use it instead of Xcode.
As for archiving, I’m now doing it all straight in the command line using Rake. Same goes for incrementing versions/uploading to TestFlight etc…
Using Alcatraz in Xcode, you can install a plugin to use cocoapods from Xcode, in the menu.
I agree. I often work with both AppCode and XCode open, using XCode for the storyboard and AppCode for the actual code.
I’m a huge fan of ctrl +t on a variable to get up the refactoring menu. And cmd + shift + a to type any command such as pull for git pull etc.
Cmd + alt + l is nice for tidying up your code. I also use cmd + F12 and type the name of the method I want to go to it.
And the git integration is light years ahead in AppCode.
Totally agree with you. More I use xCode more start to wonder if Apple doesn’t quite want to refine IDE to the point where it is pleasing to work with.
Navigating code, IdeaVIM, proper tabs, overall UI. AppCode is so much better than Xcode in those areas.