美文网首页iOS基础
post_install语法

post_install语法

作者: Maggie的小蜗居 | 来源:发表于2017-01-15 20:35 被阅读1228次

    Podfile文件描述了一个或多个工程中targets的依赖关系。

    Podfile提供了钩子在安装时调用,钩子( Hooks )是全局的 ,不存储在每个target定义里面
    项目中用到了 post_install 这个钩子

    post_install

    这个钩子允许你在生成Xcode工程或者其他你要做的操作前做最后改变

    例子:

    自定义所有targets的 build settings

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['GCC_ENABLE_OBJC_GC'] = 'supported'
        end
      end
    end
    

    参考文件:
    https://guides.cocoapods.org/syntax/podfile.html

    相关文章

      网友评论

        本文标题:post_install语法

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