From 5b23d7cf0bdb78fed650b3317783f7330692ffc5 Mon Sep 17 00:00:00 2001 From: Charles Magahern Date: Sun, 13 Oct 2019 15:51:05 -0700 Subject: [PATCH] Fix incorrect ordering of machines with mixed upper/lowercase --- XIONControlPanel/Controllers/SwitchesViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XIONControlPanel/Controllers/SwitchesViewController.swift b/XIONControlPanel/Controllers/SwitchesViewController.swift index 716a03b..cd787aa 100644 --- a/XIONControlPanel/Controllers/SwitchesViewController.swift +++ b/XIONControlPanel/Controllers/SwitchesViewController.swift @@ -94,7 +94,7 @@ class SwitchesViewController: UIViewController, { // sort devices by name 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})