Skip to content

Commit

Permalink
chore: resolve swift lints and compiler warnings (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind authored Sep 8, 2022
1 parent 4acfec2 commit ad4d975
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flutter/ios/Classes/SentryFlutterPluginApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,9 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
}

SentrySDK.configureScope { scope in
if let dictionary = value as? Dictionary<String, Any?> {
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)
Expand All @@ -492,7 +492,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
}
}

private func setUser(user: Dictionary<String, Any?>?, result: @escaping FlutterResult) {
private func setUser(user: [String: Any?]?, result: @escaping FlutterResult) {
if let user = user {
let userInstance = User()

Expand All @@ -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<String, Any?> {
if let extras = user["extras"] as? [String: Any] {
userInstance.data = extras
}

Expand All @@ -520,7 +520,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
}

// swiftlint:disable:next cyclomatic_complexity
private func addBreadcrumb(breadcrumb: Dictionary<String, Any?>?, result: @escaping FlutterResult) {
private func addBreadcrumb(breadcrumb: [String: Any?]?, result: @escaping FlutterResult) {
guard let breadcrumb = breadcrumb else {
result("")
return
Expand Down Expand Up @@ -553,7 +553,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
breadcrumbInstance.level = SentryLevel.error
}
}
if let data = breadcrumb["data"] as? Dictionary<String, Any?> {
if let data = breadcrumb["data"] as? [String: Any] {
breadcrumbInstance.data = data
}

Expand Down

0 comments on commit ad4d975

Please sign in to comment.