More modernization
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user