platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
inhibit_all_warnings!
abstract_target 'AbstractTarget' do
pod 'Masonry'
pod 'YYModel'
pod 'YTKNetwork'
pod 'MBProgressHUD'
pod 'SDWebImage'
target 'TargetA'
target 'TargetB'
target 'TargetC'
end
你會發(fā)現(xiàn)我們平時寫的Podfile中的 target 'XXX' do 變成了 abstract_target 'XXX' do,其實這里的abstract_target 'XXX'在項目的 target 是不存在的,也就是說它只是一個抽象的 target,而TargetA、TargetB及TargetC都是存在于項目中的,并依賴于AbstractTarget所包含的庫。