diff --git a/examples/swift/hello_world/BUILD b/examples/swift/hello_world/BUILD index 42f735851..eef11e39f 100644 --- a/examples/swift/hello_world/BUILD +++ b/examples/swift/hello_world/BUILD @@ -41,7 +41,7 @@ ios_application( "ipad", ], infoplists = ["Info.plist"], - minimum_os_version = "16.0", + minimum_os_version = "14.0", provisioning_profile = select({ "//bazel:ios_device_build": "//bazel/ios:ios_provisioning_profile", "//conditions:default": None, @@ -71,7 +71,7 @@ ios_application( "ipad", ], infoplists = ["Info.plist"], - minimum_os_version = "16.0", + minimum_os_version = "14.0", provisioning_profile = select({ "//bazel:ios_device_build": "//bazel/ios:ios_provisioning_profile", "//conditions:default": None, diff --git a/examples/swift/hello_world/ConfigurationView.swift b/examples/swift/hello_world/ConfigurationView.swift index fbda36ddd..14635646b 100644 --- a/examples/swift/hello_world/ConfigurationView.swift +++ b/examples/swift/hello_world/ConfigurationView.swift @@ -11,13 +11,16 @@ struct ConfigurationView: View { @StateObject var configuration = Configuration() var body: some View { - Text("API URL").frame(maxWidth: .infinity) - TextField(text: $configuration.apiURL) { Text("Enter API URL") } - .autocapitalization(.none) - - Text("API Key").frame(maxWidth: .infinity) - TextField(text: $configuration.apiKey, axis: .vertical) { Text("Enter API Key") } - .autocapitalization(.none) + Form { + Section(header: Text("API URL")) { + TextField("Enter API URL", text: $configuration.apiURL) + .autocapitalization(.none) + } + Section(header: Text("API Key")) { + TextField("Enter API Key", text: $configuration.apiKey) + .autocapitalization(.none) + } + } Spacer() diff --git a/platform/swift/source/Capture.swift b/platform/swift/source/Capture.swift index 5821932a8..8cf4a587f 100644 --- a/platform/swift/source/Capture.swift +++ b/platform/swift/source/Capture.swift @@ -23,7 +23,7 @@ extension Logger { /// `start(...)` method has not been called or if starting the logger process failed due to an internal /// error. public static var shared: Logging? { - self.getShared(assert: false) + self.getShared() } /// Initializes the Capture SDK with the specified API key, providers, and configuration. @@ -110,7 +110,7 @@ extension Logger { /// The value of this property is different for apps from the same vendor running on /// the same device. It is equal to `nil` prior to the start of bitdrift Capture SDK. public static var deviceID: String? { - return Self.getShared(assert: false)?.deviceID + return Self.getShared()?.deviceID } // MARK: - Logging @@ -351,7 +351,7 @@ extension Logger { function: String? = #function, fields: Fields? = nil ) -> Span? { - Self.getShared(assert: false)?.startSpan( + Self.getShared()?.startSpan( name: name, level: level, file: file, line: line, function: function, fields: fields ) } diff --git a/platform/swift/source/Logger.swift b/platform/swift/source/Logger.swift index e2470e44f..5ceeb907f 100644 --- a/platform/swift/source/Logger.swift +++ b/platform/swift/source/Logger.swift @@ -285,23 +285,11 @@ public final class Logger { /// Retrieves a shared instance of logger if one has been started. /// - /// - parameter assert: Whether the method should assert if shared logger has not been started. - /// /// - returns: The shared instance of logger. - static func getShared(assert: Bool = true) -> Logging? { + static func getShared() -> Logging? { return switch Self.syncedShared.load() { - case .notStarted: { - if assert { - assertionFailure( - """ - Default logger is not set up! Did you attempt to log with the default logger without \ - calling `start(withAPIKey:)` first? - """ - ) - } - - return nil - }() + case .notStarted: + nil case .started(let integrator): integrator.logger case .startFailure: