Skip to content

Instantly share code, notes, and snippets.

@fe9lix
Created February 16, 2016 19:08
Show Gist options
  • Save fe9lix/94ac697203b8c823209d to your computer and use it in GitHub Desktop.
Save fe9lix/94ac697203b8c823209d to your computer and use it in GitHub Desktop.
Xcode: Remove header comments in Swift files
find . -type f -name "*.swift" -not -path "./Pods/*" -exec sed -i '' -e '1,/^import/{/^\/\/.*/d;}' -e '/./,$!d' {} \;
@Lukaz32
Copy link

Lukaz32 commented Aug 3, 2017

It also removes my pragma mark outside my class implementation, such as: // MARK: UITableViewDelegate
Is there any way I could make it keep them?

Thanks

@stijnergeerts
Copy link

Did you find a solution for this?

Copy link

ghost commented Oct 8, 2019

Amazing!

@NikSativa
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment