Member-only story
FBiOS: The evolution of Facebook’s iOS app architecture
It has dozens of dynamically loaded libraries (dylibs), and so many classes that they can’t be loaded into Xcode at once.
According to The evolution of Facebook’s iOS app architecture
POSTED ON FEBRUARY 6, 2023 TO DEVINFRA, IOS, OPEN SOURCE
It looks like Facebook’s iOS app, FBiOS, has been around for a decade now! Can you believe it? It’s been through a lot. It started as a simple iOS codebase, but over the years, it’s turned into Frankenstein’s monster of C++, Objective-C(++), and Swift. It’s got so many dynamically loaded libraries and classes, it’s a wonder Xcode can even handle it!
And you know what else? FBiOS is practically estranged from Apple’s SDK, using in-house abstractions for everything. And, if that wasn’t enough, the app relies heavily on code generation through Facebook’s custom build system, Buck. Without it, engineers would be twiddling their thumbs all day waiting for builds to finish.
But, let’s go back to 2014 when FBiOS was still a youngling. It was having some issues with its data models, which were backed by Core Data. You see, Core Data objects are mutable, and that just wasn’t working well with FBiOS’s multithreaded architecture. So, one engineer took a look at React…