先找到数据的位置再删除或修改
- Swift 2.2
let index = self.serial?.indexOf(serial)
guard index != nil else {
return false
}
self.serial?.removeAtIndex(index!)
- Swift 3.0
let index = self.serial?.index(of: serial)
self.serial?.remove(at: index!)