分享至
var data = [1,2,3,4,5,6,7,8,9,10] func moreData(){ for i in 0..<10{ let lastItem = data.last! let newItem = lastItem + 1 data.append(newItem) } myTableView.reloadData() }
結果如下:
IT邦幫忙