Swift 2.0使用未声明的UIColor类型

时间:2023-01-23 17:24:58

Why can't i use UIColor in Swift 2.0?

为什么我不能在Swift 2.0中使用UIColor?

Makes no sense.

没有意义。

Swift 2.0使用未声明的UIColor类型

2 个解决方案

#1


32  

Just add import UIKit at the top and it will work fine.

只需在顶部添加导入UIKit即可正常工作。

#2


7  

You have to import UIKit to use UIColor.

您必须导入UIKit才能使用UIColor。

#1


32  

Just add import UIKit at the top and it will work fine.

只需在顶部添加导入UIKit即可正常工作。

#2


7  

You have to import UIKit to use UIColor.

您必须导入UIKit才能使用UIColor。