IOS
Frameworks
Pod subspec
8 min
if we have a framework that offers multiple frameworks that all together are one big solution but at the same time can be used separately we can define one "parent" framework that lists all others as subspec podspec with subspec frameworks pod spec new do |s| s name = 'mycompany' s subspec 'ui' do |ui| ui source files = 'ui xcframework' ui dependency 'mycompany/core' end s subspec 'core' do |core| core source files = 'core xcframework' end s subpsec 'calcengine' do |ce| ce source files = 'calcengine xcframework' end end install default frameworks if only "parent" framework is added to podfile all children frameworks defined as subspec will also be installed pod 'mycompany' if we look at the example podspec this will install all frameworks from podspec mycompany/core mycompany/ui mycompany/calcengine define default frameworks by default, all subspec frameworks will be installed, but it can be changed by specifying default subspec array s default subspec = 'core' this means that by defining pod mycompany in podfile it will install only mycompany/core install specific framework if we want to install a specific framework only we can define it in the podfile like this pod 'mycompany/calcengine' this will install only calcengine framework install collection of subspecs instead of typing pod 'mycompany/{framework name}' for every subspec, there's an option to install them by specifying an array of frameworks so, instead of pod 'mycompany/core' pod 'mycompany/calcengine' pod 'mycompany/ui' shorter version is pod 'mycompany', \ subspecs => \['core', 'calcengine', 'ui'] references https //guides cocoapods org/making/specs and specs repo html#examples of specifications https //guides cocoapods org/making/specs and specs repo html#examples of specifications https //guides cocoapods org/syntax/podspec html#subspec https //guides cocoapods org/syntax/podspec html#subspec