Preparing for iOS Development
Soon I’ll begin blogging more and more about iOS development. I hate XCode. Here are a few things to help get us started:
If you’re an absolute vim addict, such as myself, then pretty much everything you do on your computer is goverened by
XVim is an XCode plugin that will bring vim keybindings to your XCode. This helps make things a little bit more bearable for me. I still have other issues with XCode, like the way that XCode’s interface seems to randomly change itself based on what you’re doing to “accommodate” you better, but this helps ease the pain a little… for me :)
Follow the directions to install:
- download the code
- change the target
XVim will build itself into the appropriate location. You may have to restart XCode after.
If you get an error like:
error: garbage collection is no longer supported
Then you are probably trying to compile the XCode 4 version on XCode 5. Make sure to switch the build target.
Also make sure to click
Edit Schemes... and select Release
Another important aspect for me to start coding is having a color theme that’s easy on my eyes. I hate Visual Studio in the same way I don’t like most IDEs. But one thing I do like about Visual Studio is the Obsidian color theme. Because I did a little research before I already knew there was one available for XCode. You can grab the Obsidian XCode Theme from a GitHub gist. If you’re on XCode 4+ (which you probably should be if you’re reading this now) you can use this magic one-liner to install it (I’m gonna love myself for this later!):
mkdir -p ~/Library/Developer/Xcode/UserData/FontAndColorThemes && cd $_ && curl -O https://gist.githubusercontent.com/subdigital/837656/raw/9a97509e573b2ad9cbb3e48a1e56f6fdf5bb1c49/ObsidianCode.dvtcolortheme
The font’s a little too big for me (Menlo 18pt) so I change the font size to 10pt and disable antialiasing from OS X on fonts under that size. Right now, I’m not sure how to disable the antialiasing on Retina displays (or if it’s even possible) but from what I remember, this should handle it on non-retina displays:
defaults write com.apple.dt.Xcode NSFontDefaultScreenFontSubstitutionEnabled -bool YES
The Hex ColorPicker is an extension to the built in OS X color picker and it will allow you to enter a hex value on any color picker. It’s very useful in XCode if you are using the interface builder at all and makes creating custom color palettes easier in OS X as well.
To install, copy the
HexColorPicker.colorPicker to your
~/Library/ColorPickers directory. If it doesn’t exist, create it.
After that you might have to restart any applications you want to have the color picker available in.
Tips for Development
CMD + Shift + O
CMD + Shift + O. This keyboard shortcut will open any file or symbol in the current project or workspace, just start typing the name and it will come up. Pressing enter* will open the file. Pressing **alt + enter will open the file in a split pane (but always on the Assistant Panel).
Swapping Capslock and Ctrl keys
Something I recommend to anyone developing on any platform is to swap your CTRL and Capslock keys. Is there any time you really even need the capslock key? I know I never use it.
Some keyboards (like WASDKeyboards and Ducky) have dip switches underneath to toggle functionality of these keys on/off and swap them. This is the best way to assign Capslock to CTRL, but of course it’s not the only way. OS X also allows you to change this yourself from System Preferences.
Under System Preferences > Keyboard select *Modifier Keys… and swap to your heart’s desire:
blog comments powered by Disqus