12 2015 档案

Swift语法笔记
摘要:Guardguard是一种条件判断语句,可以类比if、assert。如果条件不符合,guard的else语句就运行,从而退出这个函数。具体写法如下:func fooGuard(x: Int?) { guard let x = x where x > 0 else { // 变量不... 阅读全文

posted @ 2015-12-29 11:50 bibibi_liuliu 阅读(322) 评论(0) 推荐(0)