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

          <bdo id='Oorz9'></bdo><ul id='Oorz9'></ul>

        <tfoot id='Oorz9'></tfoot>
      1. 需要导入 UIKit 的新项目文件

        时间:2023-05-18

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

                <bdo id='ETUCJ'></bdo><ul id='ETUCJ'></ul>
                <legend id='ETUCJ'><style id='ETUCJ'><dir id='ETUCJ'><q id='ETUCJ'></q></dir></style></legend>

                  <tbody id='ETUCJ'></tbody>
                • 本文介绍了需要导入 UIKit 的新项目文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有一个项目 A,我开始使用 Swift1-Xcode6 编写它.我有一些扩展文件,例如:

                  I have a project A, which I started writing with Swift1-Xcode6. I have some extension files like:

                  extension UIView {
                      convenience init(x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat) {
                          self.init(frame: CGRect(x: x, y: y, width: w, height: h))
                      }
                  }
                  

                  我创建了一个新项目 B 并将这些扩展文件复制到其中.我收到此错误:

                  I created a new project B and copied these extension files in there. I am getting this error:

                  UIViewExtensions.swift:11:11: Use of undeclared type 'UIView'
                  

                  Project-A 中的文件不需要包含 UIKit,但 Project-B 需要.是什么原因?

                  Files in Project-A do not need the inclusion of UIKit, but Project-B does. What is the reason?

                  推荐答案

                  这可能是因为您在桥接头中导入了一些 Objective-C 框架,而这些框架恰好在其 .h 文件中导入了 UIKit - 它会自动将 UIKit 导入到您的所有Swift 类

                  This probably happens because you import some Objective-C Frameworks in your bridging header that happens to import UIKit in its .h file - which automatically imports UIKit to all your Swift classes

                  这篇关于需要导入 UIKit 的新项目文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:从 iOS 中的 Twitter 框架获取 Twitter 句柄 下一篇:Android 测试驱动开发

                  相关文章

                • <legend id='R2S9Y'><style id='R2S9Y'><dir id='R2S9Y'><q id='R2S9Y'></q></dir></style></legend>
                • <small id='R2S9Y'></small><noframes id='R2S9Y'>

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

                      • <bdo id='R2S9Y'></bdo><ul id='R2S9Y'></ul>