【发布时间】:2019-10-07 12:50:47
【问题描述】:
我最近学习在 Xcode 11 中使用 colorLiteral 和 imageLiteral。它在我的 swift 文件中运行良好。如何在 Objective C 文件上使用 colorLiteral 和 imageLiteral?
Xcode 似乎不支持 Objective C 的 colorLiteral 和 imageLiteral。
【问题讨论】:
-
我建议不要在所有户外游乐场使用它们,但我想这种观点并不常见。如果可能,使用颜色资源并按名称加载颜色,或者至少创建一个带有颜色常量的单独
UIColor扩展。
标签: ios objective-c xcode