MacOS,iOS& TVOS文档缺少导入?

发布于 2025-02-10 07:06:31 字数 499 浏览 3 评论 0原文

我正在研究GCKeyboard的iOS/TVOS文档& GCMouse类型。

但是,Apple文档似乎缺少基本信息,例如我导入的类型。例如,C#文档始终显示MS网站上需要哪些库的类型。 Google Android文档也是如此。我在这里没有在苹果文档上看到此信息: https://developer.apple.apple.com/documentation.com/documentation /gamecontroller/gckeyboard

  • OBJC或Swift中是否有一种简单的方法可以检查类型来自何处?
  • Apple是否提供了任何方法来查找我应该导入哪种源文件?人们通常如何使用Xcode Dev工作这些缺少这些文档?

I'm looking into iOS/tvOS docs for GCKeyboard & GCMouse types.

However Apple docs seem to be missing basic info such as what I import to use a type. For example C# docs always show what libraries are needed on MS websites for types. So do Googles Android docs. I'm not seeing this on Apples docs here: https://developer.apple.com/documentation/gamecontroller/gckeyboard

  • Is there an easy way in ObjC or Swift to check where a type is from?
  • Does Apple provide any way to lookup what source file I should import for a type? How do people normally go about these lacking docs with xCode dev work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吾性傲以野 2025-02-17 07:06:31

Apple确实在其DOC上指出了该文档所指的类/对象的哪个框架是相关的。请参阅我的图片以获取详细信息。它具有从框架到其中的对象和API的文档层次结构。

专门用于GameController框架,您将使用以下导入

import GameController

一个不错的轶事:

在较旧的类和对象中,习惯将框架/库的缩写添加为名称的前缀。在这种情况下,GC(IE Game Contoller)键盘。或UI(Uikit)ViewController。借助Swiftui等新图书馆,它们已经停止使用前缀。
由于命名空间的传统objetive-c限制,使用了前缀。

Apple do indicate on its doc on which framework the class/object that the document referred to is relevant. See my picture for details. Its has a documentation hierarchy from the framework down to the objects and apis within it.

enter image description here

Specifically for GameController framework you’d use the following import

import GameController

A nice anecdote:

In older class and objects it is also customary to add the initials of the framework/library as a prefix for the name. In this case GC(i.e game contoller)Keyboard. Or UI(UIKit)ViewController. With newer libraries like SwiftUI and Combine they have stopped using the prefix.
The prefix was used due to legacy Objetive-C limitation for namespace.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文