Ios swift语法,var前面的一个额外单词
请原谅我的初学者问题 在Swift函数中,Ios swift语法,var前面的一个额外单词,ios,swift,Ios,Swift,请原谅我的初学者问题 在Swift函数中,cellForRowAt看起来既不像变量(indepathis),也不像类型(indepathis) 请拿一个战利品。如果您指定了此类参数而不是indepath,则使用该函数的开发人员将看到cellForRowAt。所以你有机会用它更具描述性 func increment(by amount: Int) { //body of the method } 你是这样使用它的: counter.increment(by: 5) counter.inc
cellForRowAt
看起来既不像变量(indepath
is),也不像类型(indepath
is)
请拿一个战利品。如果您指定了此类参数而不是indepath
,则使用该函数的开发人员将看到cellForRowAt
。所以你有机会用它更具描述性
func increment(by amount: Int) {
//body of the method
}
你是这样使用它的:
counter.increment(by: 5)
counter.increment(by: 5)