Swift 类方法
2023-11-19 本文已影响0人
山杨
class SomeClass {
class func someTypeMethod() {
// 在这里实现类型方法
}
// 类型属性(与静态属性类似)
class var theURL: URL? {
return URL(string: "https://www.cnnnd.com")
}
// 静态属性
static var theStValue: URL? = URL(string: "https://www.cnnnd.com")
}