Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy way to find all dependencies of a framework?

Tags:

xcode

macos

ios

While writing extensions in Swift / categories in Objective-C I have to decide on a structured way to organize them in my Xcode project. I thought it would be a good idea to take the dependencies of the different Apple frameworks into account.

Let's look for example at the MKMapView class of the MapKit framework. It has a property centerCoordinate that has the type CLLocationCoordinate2D. And CLLocationCoordinate2D belongs to the CoreLocation framework. Thus the MapKit framework depends on the CoreLocation framework.

(See https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKMapView_Class/index.html#//apple_ref/occ/instp/MKMapView/centerCoordinate)

I know that I can browse the corresponding header files to gather the information that I'm looking for. But this is quite tedious.

Is there somewhere an overview of the dependencies of all Apple frameworks that come with the iOS / MacOS SDKs? Or an more convenient way to determine them?

like image 906
Klaas Avatar asked Oct 10 '14 12:10

Klaas


1 Answers

Running otool (I cannot find the official manpage) with the -L option over the framework binary should give you all dependencies:

$ otool -L /path/to/ABC.framework/Versions/Current/ABC
like image 74
Droppy Avatar answered Oct 02 '22 01:10

Droppy