From 7ee7fce4edc9776eb30b2d57c62742e81577a89e Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 18 Jun 2014 10:51:10 +0800 Subject: [PATCH] Update 21_Protocols.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 另一处表达不准确 --- source/chapter2/21_Protocols.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()