【发布时间】:2015-05-15 04:36:02
【问题描述】:
以下表达式的 Swift 等价物是什么:
@property (strong, nonatomic) UIView *topView;
- (UIView *)topView {
...
}
是不是如下:
var topView: UIView {
get {
...
}
}
如果前者是真的,有没有办法定义一个外部getter?
【问题讨论】:
-
Computed Properties? -
@PeterM 你是什么意思?
-
也许这会有所帮助:(stackoverflow.com/questions/24025340/…)
-
根据您的问题标题,我会回答
Swift equivalent of Property getter是Computed Property(developer.apple.com/library/mac/documentation/Swift/Conceptual/…)。现在可能是我不明白你的实际问题。
标签: objective-c swift properties