Skip to content

Commit

Permalink
Up minimal version
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 committed May 19, 2022
1 parent 47b7c03 commit aeb7b66
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ let package = Package(
name: "OversizeUI",
defaultLocalization: "en",
platforms: [
.iOS(.v14),
.iOS(.v15),
.macOS(.v12),
.tvOS(.v14),
.tvOS(.v15),
.watchOS(.v8),
],
products: [
Expand Down
2 changes: 2 additions & 0 deletions Sources/OversizeUI/Controls/Button/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public enum ButtonType: Int, CaseIterable {
case tertiary
}

@available(tvOS, unavailable)
@available(watchOS, unavailable)
public struct OversizeButtonStyle: ButtonStyle {
private let type: ButtonType
@Environment(\.isEnabled) private var isEnabled: Bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
// ControlSizeEnvironment.swift
//

import SwiftUI

public enum ControlSize {
case mini
case small
case regular
@available(macOS 11.0, *)
case large
}

private struct ControlSizeKey: EnvironmentKey {
public static var defaultValue: ControlSize = .regular
}

public extension EnvironmentValues {
var controlSize: ControlSize {
get { self[ControlSizeKey.self] }
set { self[ControlSizeKey.self] = newValue }
}
}

public extension View {
@_disfavoredOverload
@inlinable func controlSize(_ controlSize: ControlSize) -> some View {
environment(\.controlSize, controlSize)
}
}
//import SwiftUI
//
//public enum ControlSize {
// case mini
// case small
// case regular
// @available(macOS 11.0, *)
// case large
//}
//
//private struct ControlSizeKey: EnvironmentKey {
// public static var defaultValue: ControlSize = .regular
//}
//
//public extension EnvironmentValues {
// var controlSize: ControlSize {
// get { self[ControlSizeKey.self] }
// set { self[ControlSizeKey.self] = newValue }
// }
//}
//
//public extension View {
// @_disfavoredOverload
// @inlinable func controlSize(_ controlSize: ControlSize) -> some View {
// environment(\.controlSize, controlSize)
// }
//}

0 comments on commit aeb7b66

Please sign in to comment.