You cannot ask for the last item of a
Set. Indeed, a
Set is not ordered, so there is not
last item (nor
Don't hesitate to take a look at the Swift Doc on Set.
If you want to find the last element, you need an ordered collection like an
var myArray = [1, 2, 3, 4, 5] print(myArray.last) // Display 5