Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode project dependencies graph

I am new to Swift/Objective C and Xcode. I am having hard time to understand a project which i have downloaded from GitHub. The project is very big, written in both Objective C and Swift, also includes pods.

What I was trying to generate a dependency graph of the entire code base that includes Classes, Struct etc. So that i can understand the entire hierarchy of classes, structs, functions, protocols, delegates etc. in that project.

I did find some open source tool in the GitHub but those are not able to generate the entire dependency tree/graph. And also i was trying to find, whether there is anyway I could trace the classes, functions, delegates etc that is being called while executing the app in the simulator other than putting a breakpoints.

I would highly appreciate if some can help me to find the right tools, so that it can help me to understand a big code base.

like image 425
Raj Avatar asked Sep 06 '25 03:09

Raj


2 Answers

I found some good tools to do the what you ask for, e.g. https://github.com/PrzemyslawCholewaDev/swift-dependency-visualizer But if the project gets too big, it is not very helpful anymore, since every class is drawn on the same plane. Then you should try https://swiftalyzer.com. It generates an interactive map of all of your modules, xcode groups and classes and draws dependencies between those. Very very good, but it's lacking objc support.

like image 139
Chris Avatar answered Sep 07 '25 18:09

Chris


By default, xCode has a Symbol Navigator as a part of it. It's not really what you're looking for but at least it's something.

enter image description here

When I've investigated the topic last time, I’ve found some tools for converting your iOS project to UML diagrams. And I should say it didn’t help a lot to understand the project structure, especially given the fact that UIKit likes inheriting very much. You’ll get a mass of useless information.

So, in my humble opinion, it’s much more useful just figure out the project architecture and how it implements the navigation between controllers.

like image 28
Dimitri L. Avatar answered Sep 07 '25 18:09

Dimitri L.