This is my first #iDevBlogADay post and I wanted to give a quick intro before jumping in. My name is Brandon Trebitowski and Iām a software developer and author from Albuquerque, New Mexico. I graduated from the University of New Mexico in 2008 with a bachelors degree in computer science. For the past 2 years, I have been writing mobile applications (primarily for the iPhone) for ELC Technologies.
I also started http://icodeblog.com and currently write on it about once a month.
Well, Iām sure by now, you have seen countless infographics and ācheat sheetsā chock full of XCode shortcuts, tips, etcā¦ These can be great resources, however, if you are anything like me, you see these, tweet the link, and move on never looking at them again. The only difference between these and the XCode key-bindings menu IMHO is a fancy background. So, I thought I would share some of the most important shortcuts that I have adopted to really improve my workflow. We spend so much time inside of XCode, it is worth the time to learn some of these.
By now, I would hope that you donāt click the āBuild and Go/Debugā with your mouse whenever you want to run your application. If you do, no worries, here are some of the build quick keys.
**ā return ā **This builds and launches the application in debug mode.
**shift ā return **ā Kills the running application in the simulator.
**shift ā k ā **Cleans the build target.
**shift ā a ā **Build and Analyze. This is quite possible the most important command to learn. This invokes the static analyzer to help spot memory issues in your code. Run this as early and often as possible.
My general workflow after writing a bit of code is to kill the last run, clean, analyze (hopefully not spend time on memory issues), and then build and debug. These 4 commands in sequence are much faster than searching out the menu items for each of those commands.
Navigating around files is one of the most common tasks you will perform in XCode. It is really to your advantage to speed things up.
option ā ā ā This quickly switches between your .h and .m file.
**ā ā ā **Move to the top of the file
**ā ā ā **Move to the bottom of the file
**shift ā d ā **This was recently showed to my by @cruffenach and it has drastically sped up my workflow. This is the command for āOpen Quicklyā. It brings up a small window with a search box at the top. Typing in the box instantly searches your project and allows you to quickly open up files by pressing return on the selected file. I canāt believe I had been using XCode for so long before I found out about this command.
Some commands simply donāt have quick keys. For example, I constantly use the Edit -> Sort -> By Name command to sort my source files alphabetically. By default, you must click through all of the menus and select the command to get it to work. However, XCode (like most OSX applications) will allow you to define your own quick keys and hereās how.
Well, this concludes my relatively short first post for #idevblogaday. If you have any shortcuts of your own that you canāt live without, please share them in the comments. Iām always up to improve my workflow.
Thank you to everyone (especially @mysterycoconut) for allowing me to be a part of this community and I look forward to sharing my knowledge and experiences with you.
Happy Coding!
—-