From 2ba88587b7484a4f405cd8f8f513332d413e02a2 Mon Sep 17 00:00:00 2001 From: shanksyang Date: Sun, 1 Nov 2015 07:30:33 +0800 Subject: [PATCH] chapter2, 19, type casting, swift2.1 --- source/chapter2/19_Type_Casting.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/chapter2/19_Type_Casting.md b/source/chapter2/19_Type_Casting.md index 538a53ad..b6ac013b 100644 --- a/source/chapter2/19_Type_Casting.md +++ b/source/chapter2/19_Type_Casting.md @@ -8,6 +8,9 @@ > 2.0 > 翻译+校对:[yangsiy](https://github.com/yangsiy) +> 2.1 +> 校对:[shanks](http://codebuild.me),2015-11-01 + 本页包含内容: - [定义一个类层次作为例子](#defining_a_class_hierarchy_for_type_casting) @@ -198,7 +201,7 @@ for movie in someObjects as! [Movie] { // Movie: 'Moon', dir. Duncan Jones // Movie: 'Alien', dir. Ridley Scott ``` - + ### `Any`类型 这里有个示例,使用 `Any` 类型来和混合的不同类型一起工作,包括方法类型和非 `class` 类型。它创建了一个可以存储`Any`类型的数组 `things`。 @@ -256,6 +259,3 @@ for thing in things { // Hello, Michael ``` - -> 注意: -> 在一个switch语句的case中使用强制形式的类型转换操作符(as, 而不是 as?)来检查和转换到一个明确的类型。在 `switch` case 语句的内容中这种检查总是安全的。