美文网首页
swift -- typealias---Int

swift -- typealias---Int

作者: 拥抱月亮的大星星 | 来源:发表于2016-07-07 12:04 被阅读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)

相关文章

网友评论

      本文标题:swift -- typealias---Int

      本文链接:https://www.haomeiwen.com/subject/xjkljttx.html