mirror of
https://github.com/aptabase/aptabase-swift.git
synced 2026-01-18 22:21:17 +01:00
Detect macOS Catalyst (#8)
* Detect macOS Catalyst It is currently reported as iOS, which in some technical senses is somewhat true - but does not fully capture the semantics of where the app is actually run (which is on a Mac running macOS). * Increase minimum Swift version to 5.6 Needed to support "targetEnvironment" to detect macOS Catalyst. * Report OS name as "macOS"
This commit is contained in:
@@ -10,6 +10,6 @@ Pod::Spec.new do |s|
|
||||
s.osx.deployment_target = "10.15"
|
||||
s.watchos.deployment_target = "6.0"
|
||||
s.tvos.deployment_target = "13.0"
|
||||
s.swift_version = '5.5'
|
||||
s.swift_version = '5.6'
|
||||
s.source_files = 'Sources/Aptabase/**/*'
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
// swift-tools-version: 5.5
|
||||
// swift-tools-version: 5.6
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
@@ -39,7 +39,7 @@ struct EnvironmentInfo {
|
||||
}
|
||||
|
||||
private static var osName: String {
|
||||
#if os(macOS)
|
||||
#if os(macOS) || targetEnvironment(macCatalyst)
|
||||
"macOS"
|
||||
#elseif os(iOS)
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
@@ -56,7 +56,7 @@ struct EnvironmentInfo {
|
||||
}
|
||||
|
||||
private static var osVersion: String {
|
||||
#if os(macOS)
|
||||
#if os(macOS) || targetEnvironment(macCatalyst)
|
||||
let os = ProcessInfo.processInfo.operatingSystemVersion
|
||||
return "\(os.majorVersion).\(os.minorVersion).\(os.patchVersion)"
|
||||
#elseif os(iOS)
|
||||
|
||||
Reference in New Issue
Block a user