首页 > 移动平台 > 详细

ios8:swift(1)

时间:2014-10-10 00:42:25      阅读:308      评论:0      收藏:0      [点我收藏+]

fundamental types:

    Int Double Float Bool String

collection types:

    Array Dictionary


declare constants with "let"

declare variables with "var"

with annotation(rarely used

eg:

    let a:String="good";
    var msg:String="hello";
    var a,b,c:Double;

to show a constant or variable with println (followed by a line break) or print


comments: //(single line) or /* */ (multiline)


Integers: signed and unsigned integer

8,16,32,64bit, prefer Int

in 32-bit system, Int and Int32 have same size

in 64-bit system, Int and Int64 have same size


Floating-point number:

Double: 64bit(15 decimal digits)

Float: 32bit(6 decimal digits)

本文出自 “phoenixIsland” 博客,请务必保留此出处http://phoenix2012.blog.51cto.com/1799358/1561928

ios8:swift(1)

原文:http://phoenix2012.blog.51cto.com/1799358/1561928

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!