From 17751155281e0bf8b0ce8183b8df28c487e8fefa Mon Sep 17 00:00:00 2001 From: futantan Date: Sat, 4 Jul 2015 20:55:07 +0800 Subject: [PATCH] =?UTF-8?q?Protocols=20-=20=E5=AE=8C=E6=88=90=E9=9B=86?= =?UTF-8?q?=E5=90=88=E4=B8=AD=E7=9A=84=E5=8D=8F=E8=AE=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/chapter2/22_Protocols.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/chapter2/22_Protocols.md b/source/chapter2/22_Protocols.md index 7ca35ac4..f9aaa911 100644 --- a/source/chapter2/22_Protocols.md +++ b/source/chapter2/22_Protocols.md @@ -512,13 +512,13 @@ print(somethingTextRepresentable.asText()) ## 集合中的协议类型 -协议类型可以被集合使用,表示集合中的元素均为协议类型: +协议类型可以在集合使用,表示集合中的元素均为协议类型,下面的例子创建了一个类型为`TextRepresentable`的数组: ```swift let things: [TextRepresentable] = [game,d12,simonTheHamster] ``` -如下所示,`things`数组可以被直接遍历,并调用其中元素的`asText()`函数: +如下所示,`things`数组可以被直接遍历,并打印每个元素的文本表示: ```swift for thing in things {