Fix incorrect ordering of machines with mixed upper/lowercase

This commit is contained in:
Charles Magahern
2019-10-13 15:51:05 -07:00
parent 524732c2b0
commit 5b23d7cf0b

View File

@@ -94,7 +94,7 @@ class SwitchesViewController: UIViewController,
{ {
// sort devices by name // sort devices by name
self.devices.sort(by: { (d1: WemoDevice, d2: WemoDevice) -> Bool in self.devices.sort(by: { (d1: WemoDevice, d2: WemoDevice) -> Bool in
return (d1.name.compare(d2.name) == .orderedAscending) return (d1.name.compare(d2.name, options: .caseInsensitive, range: nil, locale: nil) == .orderedAscending)
}) })
let hash = self.devices.reduce(0, {$0 ^ $1.hashValue}) let hash = self.devices.reduce(0, {$0 ^ $1.hashValue})