diff --git a/Examples/SmokeTest/SmokeTest/UIKitView.storyboard b/Examples/SmokeTest/SmokeTest/UIKitViewStoryboard.storyboard similarity index 100% rename from Examples/SmokeTest/SmokeTest/UIKitView.storyboard rename to Examples/SmokeTest/SmokeTest/UIKitViewStoryboard.storyboard diff --git a/Sources/Honeycomb/HoneycombNavigationSpanInstrumentation.swift b/Sources/Honeycomb/HoneycombNavigationSpanInstrumentation.swift index d43981c..a60a06c 100644 --- a/Sources/Honeycomb/HoneycombNavigationSpanInstrumentation.swift +++ b/Sources/Honeycomb/HoneycombNavigationSpanInstrumentation.swift @@ -16,7 +16,6 @@ func getTracer() -> Tracer { internal class HoneycombNavigationProcessor { static let shared = HoneycombNavigationProcessor() var currentNavigationPath: String? = nil - var uiKitPath: [String] = [] private init() {} @@ -72,28 +71,8 @@ internal class HoneycombNavigationProcessor { reportNavigation(path: unencodablePath) } - func setCurrentNavigationPath(_ path: String) { + func setCurrentNavigationPath(_ path: String?) { currentNavigationPath = path - uiKitPath.removeAll() - } - - func pushUiKitPath(_ path: String) { - currentNavigationPath = nil - uiKitPath.append(path) - } - - func popUiKitPath() { - uiKitPath.removeLast() - } - - func getCurrentPath() -> String? { - if let currentNavigationPath { - return currentNavigationPath - } - if !uiKitPath.isEmpty { - return uiKitPath.joined(separator: "/") - } - return nil } } @@ -120,7 +99,7 @@ public struct HoneycombNavigationPathSpanProcessor: SpanProcessor { parentContext: SpanContext?, span: any ReadableSpan ) { - if let currentPath = HoneycombNavigationProcessor.shared.getCurrentPath() { + if let currentPath = HoneycombNavigationProcessor.shared.currentNavigationPath { span.setAttribute( key: "screen.name", value: currentPath diff --git a/Sources/Honeycomb/UIKit/UIViewController.swift b/Sources/Honeycomb/UIKit/UIViewController.swift index 5f95b55..decfde9 100644 --- a/Sources/Honeycomb/UIKit/UIViewController.swift +++ b/Sources/Honeycomb/UIKit/UIViewController.swift @@ -24,7 +24,7 @@ setAttributes(span: span, className: className, animated: animated) span.end() - HoneycombNavigationProcessor.shared.pushUiKitPath(getScreenName()) + HoneycombNavigationProcessor.shared.setCurrentNavigationPath(getScreenName()) } traceViewDidAppear(animated) @@ -49,7 +49,7 @@ setAttributes(span: span, className: className, animated: animated) span.end() - HoneycombNavigationProcessor.shared.popUiKitPath() + HoneycombNavigationProcessor.shared.setCurrentNavigationPath(nil) } traceViewDidDisappear(animated)