菜鸟教程小白 发表于 2022-12-11 20:36:56

ios - 如何在 Swift 中为 iOS 创建框架/库,以便在其他项目中使用?


                                            <p><div>
            <aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
      <div class="d-flex fd-column fw-nowrap">
            <div class="d-flex fw-nowrap">
                <div class="flex--item wmn0 fl1 lh-lg">
                  <div class="flex--item fl1 lh-lg">
                        <b>关闭</b>。这个问题需要更多 <a href="https://stackoverflow.com/help/closed-questions" rel="noreferrer noopener nofollow">focused</a> .它目前不接受答案。
                        
                  <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>如果您想在您的不同项目中使用可重用的库/框架。
以下是步骤:</p>

<ol>
<li>在 Xcode 中,选择 <strong>文件 ▸ 新建 ▸ 项目...。</strong> </li>
<li>选择 <strong>iOS ▸ 框架和库 ▸ Cocoa Touch 框架。</strong>
<a href="/image/DedgH.png" rel="noreferrer noopener nofollow"><img src="/image/DedgH.png" alt="enter image description here"/></a> </li>
<li>点击<strong>下一步。</strong></li>
<li>设置<strong>产品名称</strong>,使用您自己的<strong>组织名称</strong>和<strong>组织标识符</strong>。
<a href="/image/57gH3.png" rel="noreferrer noopener nofollow"><img src="/image/57gH3.png" alt="enter image description here"/></a> </li>
<li>点击<strong>下一步。</strong></li>
<li>在文件选择器中,选择在 <strong>YourProjects</strong> 根文件夹的某个级别创建项目。</li>
<li>点击<strong>创建</strong>。</li>
</ol>

<p>您当前的状态是一个没有代码的框架,将相关代码添加到您新制作的框架中并构建框架项目,以确保您获得构建成功且没有构建警告或错误。</p>

<p>可以在链接中找到完整的分步演示:
<a href="https://www.raywenderlich.com/5109-creating-a-framework-for-ios" rel="noreferrer noopener nofollow">Creating a Framework for iOS</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 如何在 Swift 中为 iOS 创建框架/库,以便在其他项目中使用?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/52399522/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/52399522/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 如何在 Swift 中为 iOS 创建框架/库,以便在其他项目中使用?