In my application I added one object in array when select cell and unselect and remove object when re-select cell. I used that code but give me error.
extens
Try this in Swift 3
array.remove(at: Index)
Instead of
array.removeAtIndex(index)
Update
"Declaration is only valid at file scope".
Make sure the object is in scope. You can give scope "internal", which is default.
index(of:) to work, class should conform to Equatable
index(of:)
Equatable