类方法
class func customizedNavigationController() -> UINavigationController{
代码
}
对象方法
func customizedNavigationController() -> UINavigationController{
代码
}
类方法前面加小写的class
本文介绍了在Swift语言中如何定义类方法与对象方法,并通过具体示例代码展示了两者的不同之处。对于类方法,需要在方法前加上关键字'class'进行标识。
类方法
class func customizedNavigationController() -> UINavigationController{
代码
}
对象方法
func customizedNavigationController() -> UINavigationController{
代码
}
类方法前面加小写的class
497

被折叠的 条评论
为什么被折叠?