summaryrefslogtreecommitdiffhomepage
path: root/zh-cn
diff options
context:
space:
mode:
authorDamian Rzeszot <damian.rzeszot@gmail.com>2017-10-09 12:03:27 +0200
committerDamian Rzeszot <damian.rzeszot@gmail.com>2017-10-09 08:04:01 +0200
commite8ee66c854b8833fcb0fd76b5e9ace6ae8379397 (patch)
tree61dae0bfc91565c4ae654b0b0c94946baa99f1ed /zh-cn
parent9a9e52b54bf9bc6ebeefc996452f5944a234557f (diff)
swift | fix style guidelines
Diffstat (limited to 'zh-cn')
-rw-r--r--zh-cn/swift-cn.html.markdown12
1 files changed, 6 insertions, 6 deletions
diff --git a/zh-cn/swift-cn.html.markdown b/zh-cn/swift-cn.html.markdown
index 002b117f..c25b2918 100644
--- a/zh-cn/swift-cn.html.markdown
+++ b/zh-cn/swift-cn.html.markdown
@@ -469,23 +469,23 @@ print("Name: \(BookName.john.rawValue)")
// 与特定数据类型关联的枚举
enum Furniture {
// 和 Int 型数据关联的枚举记录
- case Desk(height: Int)
+ case desk(height: Int)
// 和 String, Int 关联的枚举记录
- case Chair(brand: String, height: Int)
+ case chair(brand: String, height: Int)
func description() -> String {
switch self {
- case .Desk(let height):
+ case .desk(let height):
return "Desk with \(height) cm"
- case .Chair(let brand, let height):
+ case .chair(let brand, let height):
return "Chair of \(brand) with \(height) cm"
}
}
}
-var desk: Furniture = .Desk(height: 80)
+var desk: Furniture = .desk(height: 80)
print(desk.description()) // "Desk with 80 cm"
-var chair = Furniture.Chair(brand: "Foo", height: 40)
+var chair = Furniture.chair(brand: "Foo", height: 40)
print(chair.description()) // "Chair of Foo with 40 cm"