From 99321c85ed9c73ac27aadaf5bb1c37f0e41892dd Mon Sep 17 00:00:00 2001 From: TheLittleBoy Date: Sun, 29 Jun 2014 21:14:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BC=96=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 文章正文和代码弄混了,特此修正。 --- source/chapter2/21_Protocols.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/chapter2/21_Protocols.md b/source/chapter2/21_Protocols.md index e1173fce..ff6e5d1f 100755 --- a/source/chapter2/21_Protocols.md +++ b/source/chapter2/21_Protocols.md @@ -73,9 +73,11 @@ protocol SomeProtocol { protocol AnotherProtocol { class var someTypeProperty: Int { get set } } +``` 如下所示,这是一个含有一个实例属性要求的协议: +```swift protocol FullyNamed { var fullName: String { get } } @@ -135,7 +137,7 @@ protocol SomeProtocol { 如下所示,定义了含有一个实例方法的的协议。 -``` +```swift protocol RandomNumberGenerator { func random() -> Double }