summaryrefslogtreecommitdiffhomepage
path: root/pt-pt/swift-pt.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'pt-pt/swift-pt.html.markdown')
-rw-r--r--pt-pt/swift-pt.html.markdown12
1 files changed, 6 insertions, 6 deletions
diff --git a/pt-pt/swift-pt.html.markdown b/pt-pt/swift-pt.html.markdown
index 5de2e13b..6b263942 100644
--- a/pt-pt/swift-pt.html.markdown
+++ b/pt-pt/swift-pt.html.markdown
@@ -471,23 +471,23 @@ print("Name: \(BookName.john.rawValue)")
// Enum com valores associados
enum Furniture {
// Associar com um inteiro (Int)
- case Desk(height: Int)
+ case desk(height: Int)
// Associar com uma String e um Int
- case Chair(String, Int)
+ case chair(String, 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("Foo", 40)
+var chair = Furniture.chair("Foo", 40)
print(chair.description()) // "Chair of Foo with 40 cm"