1. <i id='symN5'><tr id='symN5'><dt id='symN5'><q id='symN5'><span id='symN5'><b id='symN5'><form id='symN5'><ins id='symN5'></ins><ul id='symN5'></ul><sub id='symN5'></sub></form><legend id='symN5'></legend><bdo id='symN5'><pre id='symN5'><center id='symN5'></center></pre></bdo></b><th id='symN5'></th></span></q></dt></tr></i><div id='symN5'><tfoot id='symN5'></tfoot><dl id='symN5'><fieldset id='symN5'></fieldset></dl></div>
    • <bdo id='symN5'></bdo><ul id='symN5'></ul>

  2. <small id='symN5'></small><noframes id='symN5'>

  3. <tfoot id='symN5'></tfoot>

      <legend id='symN5'><style id='symN5'><dir id='symN5'><q id='symN5'></q></dir></style></legend>

      为什么我们使用 use_frameworks!在 CocoaPods 中?

      时间:2023-05-19
      <legend id='3RCMV'><style id='3RCMV'><dir id='3RCMV'><q id='3RCMV'></q></dir></style></legend>
      • <small id='3RCMV'></small><noframes id='3RCMV'>

            <tbody id='3RCMV'></tbody>

            <tfoot id='3RCMV'></tfoot>
              <bdo id='3RCMV'></bdo><ul id='3RCMV'></ul>
                <i id='3RCMV'><tr id='3RCMV'><dt id='3RCMV'><q id='3RCMV'><span id='3RCMV'><b id='3RCMV'><form id='3RCMV'><ins id='3RCMV'></ins><ul id='3RCMV'></ul><sub id='3RCMV'></sub></form><legend id='3RCMV'></legend><bdo id='3RCMV'><pre id='3RCMV'><center id='3RCMV'></center></pre></bdo></b><th id='3RCMV'></th></span></q></dt></tr></i><div id='3RCMV'><tfoot id='3RCMV'></tfoot><dl id='3RCMV'><fieldset id='3RCMV'></fieldset></dl></div>

                本文介绍了为什么我们使用 use_frameworks!在 CocoaPods 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我在CocoaPods Podfile中使用过use_frameworks!很多次.我只是想知道我们为什么要使用它?我无法得到直截了当的答案.

                I have used use_frameworks! in CocoaPods Podfile many times. I just wonder why do we use it? I couldn't get the straight forward answer of it.

                例子:

                platform :ios, '8.0'
                use_frameworks!
                
                target "CityWhether" do
                    pod 'Alamofire'
                    pod 'SwiftyJSON'
                end
                

                推荐答案

                use_frameworks! 告诉 CocoaPods 你想使用框架而不是静态库.由于 Swift 不支持静态库,因此您必须使用框架.

                use_frameworks! tells CocoaPods that you want to use Frameworks instead of Static Libraries. Since Swift does not support Static Libraries you have to use frameworks.

                在另一个答案中,我解释了静态库和框架之间的区别:

                In another answer, I explained the differences between Static Libraries and Frameworks:

                它们始终是开源的,并且将像您的应用一样构建.(所以Xcode 有时会编译它,当你运行你的应用程序并且总是清理项目后.)框架仅支持 iOS 8 和较新,但您可以在框架中使用 Swift 和 Objective-C.

                Cocoa Touch Frameworks

                They are always open-source and will be built just like your app. (So Xcode will sometimes compile it, when you run your app and always after you cleaned the project.) Frameworks only support iOS 8 and newer, but you can use Swift and Objective-C in the framework.

                顾名思义,它们是静态的.所以他们已经编译了,当您将它们导入您的项目.您可以与他人分享没有向他们展示你的代码.请注意,目前静态库不支持斯威夫特.您必须在图书馆.应用程序本身仍然可以用 Swift 编写.

                As the name says, they are static. So they are already compiled, when you import them to your project. You can share them with others without showing them your code. Note that Static Libraries currently don't support Swift. You will have to use Objective-C within the library. The app itself can still be written in Swift.

                来源:我的其他答案 |AddThis.com 博客

                这篇关于为什么我们使用 use_frameworks!在 CocoaPods 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何导出“脂肪"?Cocoa Touch 框架(用于模拟器和设备)? 下一篇:dyld:找不到符号:尝试运行 iOS 应用程序时的 _NSURLAuthenticationMethodClientC

                相关文章

                1. <small id='w1tJD'></small><noframes id='w1tJD'>

                2. <legend id='w1tJD'><style id='w1tJD'><dir id='w1tJD'><q id='w1tJD'></q></dir></style></legend><tfoot id='w1tJD'></tfoot>
                  <i id='w1tJD'><tr id='w1tJD'><dt id='w1tJD'><q id='w1tJD'><span id='w1tJD'><b id='w1tJD'><form id='w1tJD'><ins id='w1tJD'></ins><ul id='w1tJD'></ul><sub id='w1tJD'></sub></form><legend id='w1tJD'></legend><bdo id='w1tJD'><pre id='w1tJD'><center id='w1tJD'></center></pre></bdo></b><th id='w1tJD'></th></span></q></dt></tr></i><div id='w1tJD'><tfoot id='w1tJD'></tfoot><dl id='w1tJD'><fieldset id='w1tJD'></fieldset></dl></div>
                    <bdo id='w1tJD'></bdo><ul id='w1tJD'></ul>