# How to use By default Xcode not remove trailing whitespace from code, this gist will do it to you. Copy *remove-whitespaces.sh* anywere you like in your Mac, and be sure to give it the execute permission. Open `XCode preferences` go to `behaviors`: ![alt text][logo] [logo]: https://lh5.googleusercontent.com/-1_6mp48ViFo/VNL0q0812uI/AAAAAAAAA-Y/oUp9oOaH3og/w753-h552-no/XCode%2Bpreferences.png "XCode preferences" Use `+` sign to add new custom behavior name it with `Strip Trailing Spaces`, feel free to name it as what you want. You also can create key binding for this custom behavior, i would like make it with `⌃⌥⌘S`. Make `Run` checkbox checked, browse where you place *remove-whitespaces.sh* file. Go to menu `XCode > Behaviors > Strip Trailing Spaces` or press `⌃⌥⌘S ` to run script in your current project. Enjoy