Xcode Tips

From WikiOD

Reuse code snippets in Xcode[edit | edit source]

You can save your code snippets for use later simply by drag and drop. For eg: if you have an NSLog statement that used for so many places somewhere else in the project, then you can save the NSLog statements to code snippets library.

Xcode_Tips

Drag the NSLog statement to code snippet library.

Xcode_Tips

Now you can simply reuse the code snippet anywhere else on project. Also you can customise the code snippet and can add placeholder texts by give statements bw <# and #>.

Xcode_Tips

Drag and drop this code snippet gives an NSLog with placeholder text.

Xcode_Tips

Hide strange unwanted and extra Xcode 8 logs.[edit | edit source]

  1. From Xcode menu open: Product > Scheme > Edit Scheme.
  2. On your Environment Variables set OS_ACTIVITY_MODE = disable

Xcode_Tips

Install Plugins on Xcode 7[edit | edit source]

Xcode by itself has quite a few good tools built in, but sometimes you just want to change a specific behavior or create a convenience shortcut. That's why there's Alcatraz.

Installation[edit | edit source]

curl -fsSL https://raw.githubusercontent.com/supermarin/Alcatraz/deploy/Scripts/install.sh | sh

Throw this in a terminal, restart Xcode and you're good to go.

Recommendations[edit | edit source]

A few popular ones include:

Of course there are many more and some are so good, Apple already implemented them into Xcode 8 (FuzzyAutocomplete and VVDocumenter for example)

Usage[edit | edit source]

menu Hit ⌘ + ⇧ + 9 or use this menu to open up the Package manager.

package manager

Click install on any package you want installed and afterwards restart Xcode again.

Credit:Stack_Overflow_Documentation