From 1dca4b98e50b2269a64b72e12e7003f758797496 Mon Sep 17 00:00:00 2001 From: Charles Magahern Date: Sun, 13 Oct 2019 00:24:03 -0700 Subject: [PATCH] More modernization --- XIONControlPanel.xcodeproj/project.pbxproj | 7 +++---- XIONControlPanel/Controllers/WemoServer.swift | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/XIONControlPanel.xcodeproj/project.pbxproj b/XIONControlPanel.xcodeproj/project.pbxproj index a2551bf..9cfefad 100644 --- a/XIONControlPanel.xcodeproj/project.pbxproj +++ b/XIONControlPanel.xcodeproj/project.pbxproj @@ -257,6 +257,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -367,7 +368,6 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -406,7 +406,6 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -428,7 +427,7 @@ PRODUCT_NAME = XION; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "XIONControlPanel/SupportingFiles/XIONControlPanel-Bridging-Header.h"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -447,7 +446,7 @@ PRODUCT_NAME = XION; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "XIONControlPanel/SupportingFiles/XIONControlPanel-Bridging-Header.h"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/XIONControlPanel/Controllers/WemoServer.swift b/XIONControlPanel/Controllers/WemoServer.swift index cb04233..0348a0d 100644 --- a/XIONControlPanel/Controllers/WemoServer.swift +++ b/XIONControlPanel/Controllers/WemoServer.swift @@ -172,10 +172,10 @@ internal class FetchDevicesOperation : WemoOperation { var devices: [WemoDevice] = [] - if let responseDict = (try? JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions()) as? NSDictionary) { - for responseObj in (responseDict?.allValues)! { - if let responseDict = responseObj as? NSDictionary { - let device = WemoDevice(responseDict) + if let responseDict = try? JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary { + for responseObj in responseDict.allValues { + if let deviceDict = responseObj as? NSDictionary { + let device = WemoDevice(deviceDict) devices.append(device) } }