摘要:
//: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// 断言, 必须符合某个条件,程序才能继续运行下去// 可以看做是一个底线要求var age = 19;asse... 阅读全文
摘要:
//: Playground - noun: a place where people can play import UIKit // swift中没有被赋值的变量是不能被使用的 //var str : String //str // Optionals 可选值 (用?号体现) // 或者是一个值 阅读全文
摘要:
//: Playground - noun: a place where people can playimport UIKit// 元组就是将多个不同的值集合成一个数据/* 元组是Objective-C中没有的数据类型,与数组类似,都是表示一组数据的集合,但与数组不同,它的特点是: 特点: 1.可... 阅读全文
摘要:
//: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"let orangeAreYellowColor = truelet appleIsBlue = falseif ... 阅读全文
摘要:
//: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// 数值类型转换let three = 3let PI = Double(three) + 0.1415926 ... 阅读全文
摘要:
//: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"let 十进制的10 = 10let 八进制的8 = 0o10let 二进制的2 = 0b10let 十六进制的1... 阅读全文
摘要:
import UIKitvar str = "Hello, playground"// 显式定义浮点型常量let PI:Float = 3.141592612312312let PI2:Double = 3.14123456789123123123// 隐式定义浮点型变量var randomFloa... 阅读全文
摘要:
//: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"let MAXVALUEOFUINT8 = UInt8.maxlet MINVALUEOFUINT8 = UInt... 阅读全文
摘要:
//: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"// 常量的定义用letlet maxLoginCount = 10// 变量的定义用varvar current... 阅读全文
摘要:
//: Playground - noun: a place where people can playimport UIKitvar str = "Hello, playground"print("HelloWorld")print("hello, swift!")print("this is m... 阅读全文