Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there any way to point out or delete useless import in .m file of Objective-C

is there any way to automicly point out or delete useless import in .m file of Objective-C?

Such as my .m file :

#import "A.h"
#import "B.h"
#import "C.h"

But B.h in my .m file will never be used,is there any way to automicly point out or delete it, just like AppCode IDE.

like image 329
SubCycle Avatar asked May 11 '16 08:05

SubCycle


1 Answers

Check out here: Find unused Objective-C imports

Use as follows:

Find Unused Classes in a Path

fui --path=~/source/project/Name find

Delete All Unused Class Files w/ Prompt

fui --path=~/source/project/Name delete --perform --prompt

You can also use XCode Plugin for that:

Use xcfui for integration with XCode from here: https://github.com/jcavar/xcfui

Script to find unused imports:

https://gist.github.com/Orangenhain/7691314

like image 51
Ronak Chaniyara Avatar answered Nov 19 '22 13:11

Ronak Chaniyara