diff --git a/source/chapter2/21_Protocols.md b/source/chapter2/21_Protocols.md index 674694b0..b7dda703 100755 --- a/source/chapter2/21_Protocols.md +++ b/source/chapter2/21_Protocols.md @@ -67,7 +67,7 @@ protocol SomeProtocol { } ``` -在协议中定义类属性 (type property)时使用`class`前缀关键词,即使在结构体或者枚举中实现该协议时是使用`static`关键词: +在协议中定义类属性 (type property)时使用`class`前缀关键字,即使在结构体或者枚举中类属性是要求使用`static`前缀关键字: ```swift protocol AnotherProtocol { class var someTypeProperty: Int { get set } @@ -119,7 +119,7 @@ var ncc1701 = Starship(name: "Enterprise", prefix: "USS") 协议方法支持`变长参数(variadic parameter)`,不支持`默认参数(default parameter)`。 前置`class`关键字表示协议中的成员为`类成员`;当协议用于被`枚举`或`结构体`遵循时,则使用`static`关键字。如下所示: - +像类属性的要求一样,协议中定义类方法时也总是使用`class`关键字,即使类方法在`枚举`或`结构体`中实现时要求使用`static`关键字 ```swift protocol SomeProtocol { class func someTypeMethod()