OC, Bitcode, Swift mixed, the effect of cocoapod on the size of IPA

Come to a conclusion

(conclusions for projects in our company, data varies from project to project):

  • OC and swift / iPA package will make the increase of 20M, even if you have only a few swift files, each file swift code are not more likely to increase 20M
  • Bitcode will increase the IPA package by around 1.5M
  • Cocoapod settings, Objc open will increase the size of IPA, a few M or so, and this Objc is the best to open
  • The article also used the RAC, RAC, the size of the impact of IPA has not been tested, there is know, welcome to leave a message for me

1) OC and swift mixed, bitcode check, IPA file size 49.8M

49.8M is a bit big. When 30M, the boss wants to be a little smaller, and the 50M boss is afraid to accept it

OC, Bitcode, Swift mixed, the effect of cocoapod on the size of IPA
Snip20160809_11.png
OC, Bitcode, Swift mixed, the effect of cocoapod on the size of IPA
Snip20160809_8.png

2) OC and swift mixed, bitcode not selected, IPA file size 48.4M, 1.4M less than the above

OC, Bitcode, Swift mixed, the effect of cocoapod on the size of IPA
Snip20160809_9.png

3) delete the swift file in the project, change to pure OC, IPA is 29.7M, reduce 20M ah

OC, Bitcode, Swift mixed, the effect of cocoapod on the size of IPA
Snip20160809_10.png

4) setting Objc in cocoapod will increase IPA

Cocoapod is so easy to use tools, increase IPA or use.Cocoapod will make IPA increase, I didn’t test, see ask the foreigners.
: CocoasPod is very good, but the -ObjC will make all the object files are compiled into a binary file in the project, the use of pod AFNetworking and “ObjC” to open a an empty project, the size of IPA is 7M.google map ObjC to open, which leads to IPA 17M, so the foreigners want to know, Google Map SDK ObjC AFNetworking ObjC open, closed to reduce the size of IPA?
answer: others answer did not say how to do, just say cocoapod is doing so in order to better program the compiler.

CocoasPod is good, But sometimes it's not.Why Because there is a flag? Call "-ObjC" in your project.It will pull ALL OBJECT FILES into your resulting binary. For example, an empty project with "pod'AFNetworking'" and the flag "-ObjC" is on, that will cause the binary will be 7MB. 7MB for an empty project. That's suck. Some frameworks like Google Map SDK need the flag "-ObjC" is on.So, if your project with "AFNetworking pod" and "Google Map SDK", it will cause the binary will be 17MB. So my question is:How can I turn off the "-ObjC" flag for special Library For example just keep the? "-ObjC for Google Map SDK, but turn it off on AFNetworking.
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.

The packaged IPA sizes contain both RAC and cocoapad.RAC, and the size of the IPA has not been tested and is estimated to be within 7M,

  • The final conclusion, see the beginning of the article, there are different views, welcome messages

  • The author summarizes the experience of the development of the recommendation, continuously updated learning notes
    Runtime 10 usage (no more than the full
    iOS become the top master, you must come here (here is the best open source project and the
    iOS Reveal) reverse view any app interface
    JSPatch (real time App Store bug repair) learning (a)
    iOS senior engineer how advanced (20+
    Edition) (UIButton) click on the button to expand the range of (random direction oh)
    free certificate prototype simple debugging (original)
    through the analysis of WeChat app, learn how to use the @2x,
    MVVM and MVC @3x contrast pictures
    TableView the use of MVVM to reduce the actual controller code (56% reduction)
    ReactiveCocoa add COC Oapods configuration graphics tutorial and pit summary