摘要: 1.as的使用场合 1.从派生类转换为基类,向上转类型(upcasting) class Animal{} class Dog:Animal{} let cat = ANimal() let dog = cat as Dog 2.消除二义性,数值类型转换 let num1 = 4 as Int le 阅读全文
posted @ 2017-10-23 16:03 蓝色的风1203 阅读(438) 评论(0) 推荐(0) 编辑