简体   繁体   English

Swift:在SpriteKit中使用UIKit中的元素

[英]Swift: Working with elements from UIKit in SpriteKit

I started creating a simple game in Swift and I did not use the Single View templet (UIKit) but the Game templet (SpriteKit). 我开始在Swift中创建一个简单的游戏,但我没有使用Single View Templet(UIKit),而是使用Game Templet(SpriteKit)。

I am missing a few elements in the Game templet like the UITextfield for example and I wanted to know, if there are better ways to implement the Textfield via SpriteKit without importing UIKit because I read that this is bad coding and should not be done. 我缺少了游戏模板中的一些元素,例如UITextfield,我想知道是否有更好的方法可以通过SpriteKit而不导入UIKit来实现Textfield,因为我读到这是不好的编码,不应该这样做。

Why wouldn't you use UIKit and UITextField ? 为什么不使用UIKitUITextField It´s the default element and what´s preferred to used. 它是默认元素,是首选使用的元素。 If you don´t want to use UIKit then you should look at some 3rd party element, but I can recommend the default elements. 如果您不想使用UIKit ,则应查看一些3rd party元素,但是我可以推荐默认元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM