Clean up Objective-C code for new (≥4.3) Xcode

In Clang ≥ 3.0 (and Xcode ≥ 4.3) it is no longer required to write forward declarations of methods in class implementation. For example, if previously you wrote:

@interface MyClass ()
- (void) someFunction;
- (id) anotherFunction;
- (int) weNeedMoreFunctions;

Now, you don't need this section anymore at all.

If you want to automatically remove sections like this, use the following one-liners.

First, command for single file:

perl -0777 -i.original -pe 's/\n\@interface\ .*\n(\ *\-\ *(.*);.*\n)*.*\@end\n//g' FileName.m

Now if you want it run for all .m files recursively in folder:

find . -name '*.m' -exec perl -0777 -i.original -pe 's/\n\@interface\ .*\n(\ *\-\ *(.*);.*\n)*.*\@end\n//g' '{}' \;

Both commands will create create backup(s) for original file with ".original" extension.