这是我目前使用的解决方案:
原文链接:https://www.f2er.com/swift/319884.htmlextension Array { mutating func removeObjectAtIndexes(indexes: [Int]) { var indexSet = NSMutableIndexSet() for index in indexes { indexSet.addIndex(index) } indexSet.enumerateIndexesWithOptions(.Reverse) { self.removeAtIndex($0.0) return } } mutating func removeObjectAtIndexes(indexes: Int...) { removeObjectAtIndexes(indexes) } }