我想交换我的数组元素: swap((self.profileImages[0]), (self.profileImages[2])) 但我得到这个错误: Simultaneous accesses to 0x102944a80, but modification requires exclusive access 经过大量搜索:正如 Whats-new-in-S
swap(&(self.profileImages[0]), &(self.profileImages[2]))
但我得到这个错误:
经过大量搜索:正如 Whats-new-in-Swift-4描述的那样,我发现在swift4中我应该使用这段代码:Simultaneous accesses to 0x102944a80, but modification requires exclusive access
self.profileImages.swapAt(0, 2)