菜鸟教程小白 发表于 2022-12-11 17:30:39

ios - 如何在 Xcode8 上使用 Swift 2.2?


                                            <p><p>我有一个关于 <code>Swift2.3</code> 和 <code>XCode7</code> 的项目。效果很好。</p>

<p>当我将其更新为 <code>XCode8</code> 和 <code>Swift3</code> 后,该项目在模拟器上没有显示任何内容,因此我决定至少在目前使用 <code> <code>Xcode8</code> 上的 Swift2.2</code>(我在 <code>Swift2.2</code> 中有该项目的副本),但它给了我以下错误:</p>

<blockquote>
<p>“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.</p>
</blockquote>

<p>我已尝试转到 <code>Build Settings > Use Legacy Swift Language Version</code> 并将默认值从 <code>Unspecified</code> 更改为 <code>No</code> 但错误仍然存​​在来了。 </p>

<p>此外,我只有三个可能的值可供选择:<code>Yes</code>、<code>No</code> 或 <code>Unspecified</code>,但它们都不能修复错误。与 <code>SWIFT_VERSION</code> 值无关。</p>

<p>如何在 <code>XCode8</code> 上继续使用 <code>Swift2.2</code> 而不会出现任何错误?</p>

<p><strong>编辑:</strong>这里有一张关于我实际拥有的选项的图片:</p>

<p> <a href="/image/rVoFi.png" rel="noreferrer noopener nofollow"><img src="/image/rVoFi.png" alt="enter image description here"/></a> </p>

<p><strong>编辑2:</strong>我知道这个问题<a href="https://stackoverflow.com/questions/37835397/use-swift-2-2-in-xcode-8" rel="noreferrer noopener nofollow">Use Swift 2.2 in Xcode 8?</a>但正如您在上图中看到的那样,我没有选项 <code>SWIFT_VERSION</code> 所以出现在那里的唯一答案对我不起作用。</p>

<p>提前致谢! </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您必须在其中输入值 <code>2.3</code>。</p>

<p> <a href="http://imgur.com/a/pcLIJ" rel="noreferrer noopener nofollow">http://imgur.com/a/pcLIJ</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 如何在 Xcode8 上使用 Swift 2.2?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/39490507/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/39490507/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 如何在 Xcode8 上使用 Swift 2.2?