Modularization of an iOS application: why and how we split Badoo into modules

In Badoo iOS development, we've been building modules for several years now, and most of the new code is developed outside of the app codebase. We now have over 100 modules for Badoo and Bumble. In this article, I will share our experience and answer the most popular questions about modularization: 





  • by what principle to allocate modules; 





  • how to organize connections between them; 













  • ;













, iOS- Core- , FunCorp « ». .





— , , . , . :





  1. . , — , . .





  2. . , , - . — , , .





, . ?





  1. . : . 





  2. . , , .





  3. . , .





  4. . , , , , . .





, , , - .





? , , , : , , . . : ? :





  • — : «», «», «». .





  • () , - (, ) .





, .   ( ). , - “” -.





— - iOS, Apple ID. , iOS, Apple Apple ID. . ?





  1. .





  2. .





  3. Apple ID .









  4. !





, . .





, ?

 





, :





  1. . - , (, , . .), -.





  2. . view- . UIKit -.





  3. , UI. . .





, ( ). :





(, ), — . , , , UI . 





, UI- . : ?





UIGallery, UI-. - — :





  • UI : , ;





  • , ( , );





  • (Visual Regression Test, VRT) . , : . -, VRT : , . .





, Badoo Bumble:





  • 110 ;





  • - , ;





  • ;





  • ;





  • : .





, , . , , . .





, . Badoo, .





, , , , . .





— : . ( 100), , , . , . . , .





, , 1, , . , , , , . . , , . , . «» , , .





, , — . , , .





, . , . - , , , , , — , . . , - , , .





?





  1. Badoo ( Chat, ChatUI ChatService).





  2. Bumble. , , Badoo, Bumble. , Bumble, Badoo. , .





  3. , . — . , , .





  4. , .









  1. . , .





  2. . , , .





  3. , . : , , , - , , . . , .





  4. , . , QA, — , . .





iOS-, . 









, , — . , , 50 - Swift , . Build Settings . , , , .





, : ? Swift? / Bitcode? . . , . .





, : , debug-, Bitcode debug- . . ?





. ( ) CocoaPods. Development-, , post_install- . , , CocoaPods, , . , , , - . , CocoaPods — Enterprise- , . .





. — xcconfig’. . xcconfig:





  1. , Xcode (xcodeproj/project.pbxproj).





  2. . #include.





  3. , .





, , , build- (Debug, Release, Production ). .





: Bundle ID, Info.plist, modulemap:





xcconfig , , :





  1. .





  2. .





  3. .





  4. .





, Git pre-commit hooks Build Settings .









, , — . , , , . Xcode .





, , , build- . — , CocoaPods, , Xcodeproj « , , xcworkspace».





, , . . .





- « », : ? .





-, , . , , .  





-, . , Xcode : Framework Search Paths Derived Data.





(, ).





-, — . , , .





, , . , , . . .









— . , , . :





  1. Xcode . .





  2. — . , .





  3. - , - . . .





  4. . , — . , , , , , .





? — Swift-, , . Standalone- XcodeGen. Deps, . :





, , xcconfig. :





  1. , .





  2. .





  3. xcconfig’.





  4. .





  5. .





, . xcconfig, . , Swift , . 





, , …





. !








All Articles