假设我的数组是这样的:
let test = ["1", "2", "3", "4", "5"]
在 tableView 中,它看起来像这样:
1
2
3
4
5
但我希望它看起来像这样:
5
4
3
2
1
我将其用于 cell.text:
cell.textLabel?.text = dataArray[indexPath.row] as? String
有什么建议吗?
最佳答案
我相信这应该有效。
dataArray[dataArray.count - 1 - indexPath.row]
关于ios - 重新排序数组以获得 TableView 中的最后一个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33658698/