Eyes, JAPAN Blog > A useful tool for refactoring iOS project

A useful tool for refactoring iOS project

will

この記事は1年以上前に書かれたもので、内容が古い可能性がありますのでご注意ください。

Refactoring is not always an easy job. For an iOS project, to refactor UI part is easier if storyboard is correctly used. However, it is not so easy to refactor the logic of whole application, if there is not any implementation document. A class diagram can help to have an overview of dependency of all classes easily, which can be used to refactor from class point of view as the first step.
There is a useful tool, objc_dep, to generate class diagram from source code[1].
To generate class diagram following the steps[2]:
1. Download objc_dep from Github.
$ git clone https://github.com/jomnius/objc_dep.git
2. In the downloaded folder, generate graph from iOS project folder.
$ python objc_dep.py /path/to/iOSproject > graphname.dot

The generate graph also contain other classes of 3rd party library, which is not so helpful to refactor. We need to remove these classes by some editing tool like OmniGraffle.
Then you can start refactoring, enjoy.

References:
[1] Dependency Graph Tool for iOS Projects
[2] Git repository for the tool

  • このエントリーをはてなブックマークに追加

Comments are closed.