Xcode Tips
Reuse code snippets in Xcode
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.
Drag the NSLog statement to code snippet library.
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 #>.
Drag and drop this code snippet gives an NSLog with placeholder text.
Install Plugins on Xcode 7
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
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
A few popular ones include:
VVDocumenter
- Type three/
above any method, class, … declaration to add documentationXcodeColors
- Colored console logs, e. g. using CocoaLumberjackFuzzyAutocomplete
- Type “NSog” and still getNSLog
autocompletedBuildTimeAnalyzer
- Set-Xfrontend -debug-time-function-bodies
underOther Swift flags
in the build settings and optimize your Swift build time
Of course there are many more and some are so good, Apple already implemented them into Xcode 8 (FuzzyAutocomplete and VVDocumenter for example)
Usage
Hit ⌘ + ⇧ + 9
or use this menu to open up the Package manager.
Click install on any package you want installed and afterwards restart Xcode again.
Hide strange unwanted and extra Xcode 8 logs.
- From Xcode menu open: Product > Scheme > Edit Scheme.
- On your Environment Variables set OS_ACTIVITY_MODE = disable