static在Swift 中表示 “类型范围作用域”

In Swift, however, type properties are written as part of the type’s definition, within the type’s outer curly braces, and each type property is explicitly scoped to the type it supports.

You define type properties with the static keyword. For computed type properties for class types, you can use the class keyword instead to allow subclasses to override the superclass’s implementation. The example below shows the syntax for stored and computed type properties:

 

https://docs.swift.org/swift-book/LanguageGuide/Properties.html#ID264

posted @ 2019-07-22 14:44  zzfx  阅读(365)  评论(0编辑  收藏  举报