随笔分类 - swift
摘要:强类型语言;每句代码可以不用分号分隔;大小写敏感; 变量声明: var a = 0 常量声明 let b = 3.14 常量不能+变量?a+b 类型标注 var s :String 打印 pringln(a) 断言 assert()
阅读全文
摘要:1nil聚合运算符 nil coalescing operator a ?? b == a!=nil ? a! : b 要求: 1a是一个可选类型 2b必须和a解包后类型一致 var userNickName:String? //let outputName:String = userNickNam
阅读全文
摘要:1整形 Int,Int8,Int16,Int32,Int64 UInt,UInt8,UInt16,UInt32,UInt64 其中Int,UInt始终和当前平台的原生字长相同(32位机,64位机) 查看属性 UInt8.min UInt8.max 初始化 var sampleInteger:Int
阅读全文
摘要:var array = ["A","B"] var array2:[String] = ["A","B"] var array3:Array = ["A","B"] 创建 var array = "Int" var array2 = Array() var array3 = "Int" count
阅读全文
摘要:func add(a:Int,b:Int) Int { return a+b }
阅读全文
摘要:var label = UILabel(frame: CGRectMake(10, 20, 300, 100)) label.text = "《Swift语言实战入门》" self.view.addSubview(label) label.textColor = UIColor.whiteColor
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit impo
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit impo
阅读全文
摘要:// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fangyuhao. All rights reserved. // import UIKit clas
阅读全文

浙公网安备 33010602011771号