I have an array of [myObject]
called myArray
and an myObject
object.
I want to check if myObject
is the last object in myArray
.
What is the best way to do it?
I've tried:
if myObject == myArray.last!
but it gives me this error:
Binary operator '==' cannot be applied to two 'myObject' operands
Any idea? Thanks!