working with cocoapods ios

cocoapods, ios

Solution

In general, adding a static library to your project in Objective-C will pull ALL OBJECT FILES into your resulting binary because cocoa pods installation adds -ObjC flag to your linker settings, and as stated in linker manual:

-ObjC        Loads all members of static archive libraries that implement
             an Objective-C class or category.

This flag included to solve problem with linking categories, because by default linker will not include object files containing only categories into resulting binary.

So, in general, be carefull when adding a big library to you project via CocoaPods.

Problem

I know cocoapod is simplifying the efforts of manually adding libraries or let developer concentrate on his actual source code. But my question is if I need only some of source file from certain project then is good to add whole library by installing same cocoapod? Like if I need only `Reachability` class file then why should I take whole `AFNetworking` Isn't it creating code redundancy or increasing my iPA size or other performance issues?

Original source