Switch
来源:互联网 发布:c语言中的注释 编辑:程序博客网 时间:2024/04/30 10:29
Swift 中得Swich 和OC主要区别有2个
1.条件不在局限于整形 现在可以用字符串
let thing = "食物"switch thing { case "食物": println("可以吃") case "衣服": println("可以穿")default: println("作用未知")}
2 现在默认是不会穿透的 就是要么执行其中一个case 要么执行default,如果想要穿透到下一个 需要关键字fallthrough
<pre name="code" class="objc">let thing = "食物"switch thing { case "食物": println("可以吃") fallthrough case "衣服": println("可以穿")default: println("作用未知")}
0 0
- switch
- Switch
- Switch
- switch
- switch
- switch
- Switch
- switch
- switch
- switch
- SWITCH
- Switch
- switch
- switch
- switch
- (switch)
- switch
- switch
- 顺序存储与链式存储
- NVIDIA Tesla C2050 安装显卡驱动及cuda
- Android Studio 导出APK
- 第十一周项目六-回文-素数3
- apache 一些与模块相关的异常
- Switch
- 各种求爬求蜘蛛然后再求蜘蛛
- 批量更改图像文件名称
- 第11周项目七 太乐(泰勒)了
- Android滑动菜单特效实现,仿人人客户端侧滑效果,史上最简单的侧滑实现
- lua: tolua++实现分析
- Matlab 三维视图的自动旋转
- linux 时间设置
- C++备忘 extern static