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)
本文标题:swift -- typealias---Int
本文链接:https://www.haomeiwen.com/subject/xjkljttx.html
网友评论