摘要: Connect the UI to Code 主题 The weak keyword means that it’s possible for that property to have no value (be nil) at some point in its life. - @IBOutlet 阅读全文
posted @ 2016-04-30 10:35 yshgxm 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Build a Basic UI The AppDelegate class contains a single property: window. With this property the app delegate keeps track of the window in which all 阅读全文
posted @ 2016-04-26 17:24 yshgxm 阅读(107) 评论(0) 推荐(0) 编辑
摘要: import UIKit var v = UIView(frame:CGRectMake(0,0,200, 200)) var b = UIButton(frame: CGRectMake(0, 0, 44, 44)) b.setTitle("44pix btn", forState: UICont 阅读全文
posted @ 2016-03-05 22:53 yshgxm 阅读(93) 评论(0) 推荐(0) 编辑
摘要: //// protocol ExampleProtocol{ var simpleDescription :String{get} mutating func adjust() } class SimpleClass:ExampleProtocol{ var simpleDescription:St 阅读全文
posted @ 2016-03-05 00:03 yshgxm 阅读(93) 评论(0) 推荐(0) 编辑
摘要: //// enum Suit{ case Spades,Hearts,Diamonds,Clubs func simpleDescription () ->String{ switch self { case .Spades: return"Spades" case .Clubs: return " 阅读全文
posted @ 2016-03-03 23:35 yshgxm 阅读(123) 评论(0) 推荐(0) 编辑
摘要: // func sumOf(numbers:Int...)->Int{ var sum=0 for number in numbers { sum+=number } return sum } sumOf() sumOf(4,5,12) // func returnFifteen()-> Int{ 阅读全文
posted @ 2016-03-02 23:28 yshgxm 阅读(112) 评论(0) 推荐(0) 编辑
摘要: // Playground - noun: a place where people can play swift2.2 NO.1 import UIKit var str = "Hello, playground" // Playground - noun: a place where peopl 阅读全文
posted @ 2016-03-01 23:32 yshgxm 阅读(224) 评论(0) 推荐(0) 编辑
摘要: // Playground - noun: a place where people can play swift2.2 NO.2 import UIKit var str = "Hello, playground" let interestingNumbers=[ "Prime":[2,3,5,7 阅读全文
posted @ 2016-03-01 23:31 yshgxm 阅读(182) 评论(0) 推荐(0) 编辑