Modularisasi aplikasi iOS: mengapa dan bagaimana kami membagi Badoo menjadi beberapa modul

Dalam pengembangan Badoo iOS, kami telah membuat modul selama beberapa tahun, dan sebagian besar kode baru dikembangkan di luar basis kode aplikasi. Kami sekarang memiliki lebih dari 100 modul untuk Badoo dan Bumble. Pada artikel ini, saya akan membagikan pengalaman kami dan menjawab pertanyaan paling populer tentang modularisasi: 





  • dengan prinsip apa untuk mengalokasikan modul; 





  • bagaimana mengatur hubungan di antara mereka; 













  • ;













, 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