You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The accent color defined in the app's assets is respected.
Actual Result
It is not.
I believe this is a regression of of #54. It seems that when the library was re-written in Swift, it began using the deprecated UIScreen.main symbol again. Applying the following diff appears to fix it:
diff --git a/PostHog/PostHogContext.swift b/PostHog/PostHogContext.swift
index 2042c58e8..54fd1d4b7 100644
--- a/PostHog/PostHogContext.swift+++ b/PostHog/PostHogContext.swift@@ -123,8 +123,10 @@ class PostHogContext {
var properties: [String: Any] = [:]
#if os(iOS) || os(tvOS)
- properties["$screen_width"] = Float(UIScreen.main.bounds.width)- properties["$screen_height"] = Float(UIScreen.main.bounds.height)+ if let screen = UIApplication.shared.windows.first?.screen {+ properties["$screen_width"] = Float(screen.bounds.width)+ properties["$screen_height"] = Float(screen.bounds.height)+ }
#elseif os(macOS)
if let mainScreen = NSScreen.main {
let screenFrame = mainScreen.visibleFrame
The text was updated successfully, but these errors were encountered:
Version
3.14.1
Steps to Reproduce
Expected Result
The accent color defined in the app's assets is respected.
Actual Result
It is not.
I believe this is a regression of of #54. It seems that when the library was re-written in Swift, it began using the deprecated
UIScreen.main
symbol again. Applying the following diff appears to fix it:The text was updated successfully, but these errors were encountered: