class ca{
var v:[Int] = [Int]();
subscript(index:Int)->Int{
return v[index];
}
}
var v = ca();
v.v.append(1);
v.v.append(2);
println(v[1]);
原文链接:https://www.f2er.com/swift/326859.htmlclass ca{
var v:[Int] = [Int]();
subscript(index:Int)->Int{
return v[index];
}
}
var v = ca();
v.v.append(1);
v.v.append(2);
println(v[1]);
原文链接:https://www.f2er.com/swift/326859.html