class student: NSObject {
//类属性
var name:String = "小明";
var Num:Int = 3;
//类构造函数
init(newName:String,newNum:Int) {
self.name = newName;
self.Num = newNum;
}
//反初始化方法
deinit {
}
//类方法
func studentFunc(aName:String) -> String {
return "\(name)======\(Num)=======\(aName)";
}
}
//声明对象
let astudent = student(newName: "小明", newNum: 3);
//类方法调用
print("\(astudent.studentFunc(aName: "111"))");