Post

Replies

Boosts

Views

Activity

Reply to 'UIScreen' is unavailable in visionOS, how to fix it? Is there anything to replace UIScreen?
My workaround for now, taking sidebar visibility into consideration. var screenWidth: Int? = nil if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene { if splitViewVisibility == .detailOnly { screenWidth = Int(windowScene.coordinateSpace.bounds.width) }else{ screenWidth = Int(windowScene.coordinateSpace.bounds.width) - 320 } }
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’24
Reply to 'UIScreen' is unavailable in visionOS, how to fix it? Is there anything to replace UIScreen?
My workaround for now, taking sidebar visibility into consideration. var screenWidth: Int? = nil if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene { if splitViewVisibility == .detailOnly { screenWidth = Int(windowScene.coordinateSpace.bounds.width) }else{ screenWidth = Int(windowScene.coordinateSpace.bounds.width) - 320 } }
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’24