Appearance
Top-Level Symbols & Namespaces
8.1 Logging
swift
public enum LogLevel { case verbose, debug, info, warning, error }
extension SB_SDK {
public static var log: AnyPublisher<(LogLevel, String, String, String, Int), Never>
}Subscribe SB_SDK.log to forward SDK log entries into your own logging pipeline (Crashlytics, OSLog, custom file sink, etc.).
8.2 Environment
swift
extension SB_SDK {
public enum Environment {
case staging
case production
}
}8.3 Constants namespace
swift
public enum SDKConstants {
public static let SDKLicenseKey: String
public static let RIGHT: Int
public static let LEFT: Int
public static let MaxWalkingPace: Int
public static let firmwareUpdateReconnectDelay: TimeInterval
public static let HRM_SAMPLING_INTERVAL_DEFAULT: Int
public enum DefaultUserMetrics {
public static let Age: Int32
public static let Height: Float
public static let RHR: Int32
public static let RunStride: Int32
public static let Sex: Int32
public static let WalkStride: Int32
public static let Weight: Float
}
}DefaultUserMetrics.Sex is in the SDK's storage convention — 0 male, 1 female, 2 undisclosed — the same numbering SB_UserProfile.sex persists. Note this is not the bioedge C numbering (GENDER_MALE = 1), which counts the same three cases from one; conflating the two silently shifts every user by one case (SB-1735).
8.4 Globals namespace
swift
public enum SDKGlobals {
public static let defaultPPGDuration: Int
public static func getUserAge(birthday: DateComponents) -> Int?
public static func calcBMR(male: Bool, weight: Double, height: Double, age: Int) -> Double
public static func calcCFF(age: Int, rhr: Int) -> Double
}
public var gblIsMetric: Bool { get set }8.5 Dependency-injection container
swift
public struct Injectable<T> {
public let wrappedValue: T
public init()
}
public final class Container: @unchecked Sendable {
public static let shared: Container
public func register<T>(_ type: T.Type, instance: T)
public func resolve<T>(_ type: T.Type) -> T?
public func resolve<T>(_ type: T.Type) -> T
}8.6 Diagnostic logger
swift
public class SB_FXCLogging: NSObject {
public enum InfoType: String { … }
public enum LEVEL { … }
public var minLevel: LEVEL
public var prefix: String
public func verbose(_ value: String?, …)
public func debug(_ value: String?, …)
public func info(_ value: String?, …)
public func warning(_ value: String?, …)
public func error(_ value: String?, …)
public func alwaysLog(_ value: String?, …)
public func fullLogURL() -> URL?
}