【发布时间】:2019-10-12 07:11:59
【问题描述】:
问题是,我想在我的扩展文件上创建一个扩展,如下所示。
extension Notification.Name {
static let value = Notification.Name(rawValue: "value")
}
但不幸的是,它正在读取我名为 Notification 的自定义类,而我这次只想直接访问基础...所以我可以去 .Name
除了方法之外,还有像@DoNotReadCustomClass 这样的android 中提到的方法吗?哈哈之类的?
@onlyGoForFundationClass? @exeptionForThisTimeOnCustomClass 或类似的东西?
谢谢。
【问题讨论】:
-
重命名您的自定义类。 覆盖系统结构/类是不好的做法
-
好建议!谢谢。赞赏!