//下标subscript,可以有多个参数
subscript(index:int)->
{
get{
return images[index]
}
set{
images[index]=newValue
}
}
func getImage(index:Int)->
{
return images[index]
}
let xc=XiangCe()
xc.getImage(0)
xc[0]
xc[0]=100
xc[0]
//下标subscript,可以有多个参数
subscript(index:int)->
{
get{
return images[index]
}
set{
images[index]=newValue
}
}
func getImage(index:Int)->
{
return images[index]
}
let xc=XiangCe()
xc.getImage(0)
xc[0]
xc[0]=100
xc[0]