swift -- typealias---Int
2016-07-07 本文已影响26人
拥抱月亮的大星星
typealias;给某个类型取个别名,和oc中给block起个别名类似
UInt8:0~255 (0~2^8)
Int8:-256~255 (-2^8 ~ 2^8-1)
Int16 , Int32, Int64类似
typealias HZ = UInt8;
var value:HZ;
value = 255; //256会报错
print(value)
typealias;给某个类型取个别名,和oc中给block起个别名类似
UInt8:0~255 (0~2^8)
Int8:-256~255 (-2^8 ~ 2^8-1)
Int16 , Int32, Int64类似
typealias HZ = UInt8;
var value:HZ;
value = 255; //256会报错
print(value)