美文网首页
iOS-工程多target下的Podfile配置

iOS-工程多target下的Podfile配置

作者: yunxiu | 来源:发表于2022-06-06 18:00 被阅读0次

两种方式:

1,

# 使用关键字abstract_target,使用多个target共享同一个pod,这里是common_pod

abstract_target 'common_pod' do

    pod 'AFNetworking'

    # targetA 单独拥有

    target 'targetA' do

        pod 'Masonry'

    end

    # targetB 单独拥有   

    target 'targetB' do

        pod 'SDWebImage'

    end

end

2,

# 共同的pod

def commonPods

    pod 'Masonry', '~> 1.1.0'

end

# targetA

target 'targetA' do

    commonPods

    pod 'AFNetworking', '~> 3.2.1'

end

# targetB

target 'targetB' do

    commonPods

    pod 'YYModel'

end

相关文章

网友评论

      本文标题:iOS-工程多target下的Podfile配置

      本文链接:https://www.haomeiwen.com/subject/rmijmrtx.html