swift语言学习
文章平均质量分 78
dvstter
这个作者很懒,什么都没留下…
展开
-
Methods
Instance Methods 对象方法 class Counter { var count = 0 func increment() { count++ } func incrementBy(amount: Int) { count += amount } func reset() { count原创 2015-03-05 08:41:25 · 261 阅读 · 0 评论 -
Subscripts
Classes, structures, and enumerations can define subscripts, which are shortcuts for accessing the member elements of a collection, list or sequence. 类、结构体、枚举都可以定义脚注(也就是someArray[3]中的中括号和里面的数字3) You原创 2015-03-05 09:34:40 · 542 阅读 · 0 评论 -
Inheritance
Defining a Base Class 定义一个基类 Any class that does not inherit from another class is known as a base class. 一个不从任何类继承的类就是基类 // Inheritance class Vehicle { var currentSpeed = 0.0 var descriptio原创 2015-03-06 09:01:50 · 273 阅读 · 0 评论