Skip to content

OSInfo UIKit & UIDevice #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Sources/Features/Attributes/System.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Foundation
import MachO
import Darwin
#if canImport(UIKit)
import UIKit
#endif

struct Statistics {

Expand Down Expand Up @@ -336,7 +339,7 @@ struct OSInfo {
return "tvOS"
#elseif os(watchOS)
return "watchOS"
#elseif os(iOS) && !targetEnvironment(macCatalyst)
#elseif os(iOS) && canImport(UIKit) && !targetEnvironment(macCatalyst)
return UIDevice.current.systemName
#elseif os(iOS) && targetEnvironment(macCatalyst)
return "Catalyst"
Expand All @@ -346,7 +349,7 @@ struct OSInfo {
}

static var version: String {
#if os(iOS) && !targetEnvironment(macCatalyst)
#if os(iOS) && canImport(UIKit) && !targetEnvironment(macCatalyst)
return UIDevice.current.systemVersion
#elseif os(watchOS)
let version = ProcessInfo.processInfo.operatingSystemVersion
Expand Down