iOS Swift 数组 交换元素的两种方法

 

 

 

 

//1
swap(&arr[fromIndexPath.row], &arr[to.row])

//2
(arr[fromIndexPath.row],arr[to.row]) = (arr[to.row],arr[fromIndexPath.row])

 

posted @ 2016-08-16 18:15  Ficow  阅读(2331)  评论(0编辑  收藏  举报