From ad4d97585e9331d919876ce69785c1543fb5e433 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Thu, 8 Sep 2022 08:50:35 +0200 Subject: [PATCH] chore: resolve swift lints and compiler warnings (#999) --- flutter/ios/Classes/SentryFlutterPluginApple.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flutter/ios/Classes/SentryFlutterPluginApple.swift b/flutter/ios/Classes/SentryFlutterPluginApple.swift index 174bfdeb8e..2592b8b977 100644 --- a/flutter/ios/Classes/SentryFlutterPluginApple.swift +++ b/flutter/ios/Classes/SentryFlutterPluginApple.swift @@ -466,9 +466,9 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { } SentrySDK.configureScope { scope in - if let dictionary = value as? Dictionary { + if let dictionary = value as? [String: Any] { scope.setContext(value: dictionary, key: key) - } else if let string = value as? String? { + } else if let string = value as? String { scope.setContext(value: ["value": string], key: key) } else if let int = value as? Int { scope.setContext(value: ["value": int], key: key) @@ -492,7 +492,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { } } - private func setUser(user: Dictionary?, result: @escaping FlutterResult) { + private func setUser(user: [String: Any?]?, result: @escaping FlutterResult) { if let user = user { let userInstance = User() @@ -508,7 +508,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { if let ipAddress = user["ip_address"] as? String { userInstance.ipAddress = ipAddress } - if let extras = user["extras"] as? Dictionary { + if let extras = user["extras"] as? [String: Any] { userInstance.data = extras } @@ -520,7 +520,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { } // swiftlint:disable:next cyclomatic_complexity - private func addBreadcrumb(breadcrumb: Dictionary?, result: @escaping FlutterResult) { + private func addBreadcrumb(breadcrumb: [String: Any?]?, result: @escaping FlutterResult) { guard let breadcrumb = breadcrumb else { result("") return @@ -553,7 +553,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin { breadcrumbInstance.level = SentryLevel.error } } - if let data = breadcrumb["data"] as? Dictionary { + if let data = breadcrumb["data"] as? [String: Any] { breadcrumbInstance.data = data }