官术网_书友最值得收藏!

Methods

Methods are functions that are associated with a particular type. Instance methods are functions that are called on an instance of a particular type. Type methods are functions that are called on the type itself.

The following example presents a class containing a type method that is named someTypeMethod():

class AClass { 
class func someTypeMethod() {
// type method body
}
}
// We can call this method as follows:
AClass.someTypeMethod()
主站蜘蛛池模板: 麻江县| 馆陶县| 凤台县| 巫溪县| 怀来县| 东港市| 潞城市| 九龙县| 石阡县| 九江县| 泰兴市| 陇西县| 长春市| 龙川县| 昌吉市| 中西区| 金川县| 禄劝| 沁阳市| 镶黄旗| 紫云| 昌都县| 洮南市| 临漳县| 龙岩市| 凤冈县| 扎赉特旗| 当雄县| 岳池县| 博湖县| 仁布县| 河津市| 合水县| 宁陵县| 讷河市| 无极县| 抚松县| 永登县| 广饶县| 连山| 读书|