I\'m sorting tableview using this code:
list.sort() { $0.points > $1.points }
And everything works fine (For a bit) If I use this sort m
That's the normal behavior when comparing strings. Strings are not numbers.
The method localizedStandardCompare compares like in Finder
and handles numeric strings correctly
list.sort() { $0.points.localizedStandardCompare($1.points) == .orderedDescending }
Alternatively compare with .numeric option
list.sort() { $0.points.compare($1.points, options: .numeric) == .orderedDescending }