Skip to content

Commit

Permalink
Fix platform
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 committed Sep 26, 2024
1 parent 94505bc commit b8cf6bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
14 changes: 7 additions & 7 deletions Sources/OversizeUI/Core/EnvironmentKeys/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ public enum Platform {

private struct PlatformKey: EnvironmentKey {
static let defaultValue: Platform = {
#if canImport(UIKit)
#if os(macOS) || targetEnvironment(macCatalyst)
return .mac
#elseif os(watchOS)
return .watch
#elseif os(visionOS)
return .vision
#elseif canImport(UIKit)
switch UIDevice.current.userInterfaceIdiom {
case .phone:
return .iPhone
Expand All @@ -33,12 +39,6 @@ private struct PlatformKey: EnvironmentKey {
@unknown default:
return .other
}
#elseif os(watchOS)
return .watch
#elseif os(visionOS)
return .vision
#elseif os(macOS) || targetEnvironment(macCatalyst)
return .mac
#else
return .other
#endif
Expand Down
11 changes: 1 addition & 10 deletions Sources/OversizeUI/Shapes/RoundedRectangleCorner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,19 @@
// RoundedRectangleCorner.swift, created on 11.09.2021
//

#if os(iOS)
#if canImport(UIKit)
import SwiftUI

@available(watchOS, unavailable)
@available(tvOS, unavailable)
@available(macOS, unavailable)
public struct RoundedRectangleCorner: Shape {
private var radius: CGFloat = .infinity

private var corners: UIRectCorner = .allCorners

@available(watchOS, unavailable)
@available(tvOS, unavailable)
@available(macOS, unavailable)
public init(radius: CGFloat, corners: UIRectCorner) {
self.radius = radius
self.corners = corners
}

@available(watchOS, unavailable)
@available(tvOS, unavailable)
@available(macOS, unavailable)
public init(radius: Radius, corners: UIRectCorner) {
self.radius = radius.rawValue
self.corners = corners
Expand Down

0 comments on commit b8cf6bc

Please sign in to comment.