Skip to content

Commit

Permalink
Fix multi-platform builds
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Mar 16, 2024
1 parent 95a3687 commit 17c914c
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 22 deletions.
2 changes: 0 additions & 2 deletions Sources/SwiftUIKit/Lists/ListAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ public enum ListAction {
/// Call a certain phone number.
case call(phoneNumber: String)

#if os(macOS) || os(iOS)
/// Copy a certain value.
case copy(String)
#endif

/// Email a certain address.
case email(address: String)
Expand Down
2 changes: 2 additions & 0 deletions Sources/SwiftUIKit/Lists/ListSelectItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ public struct ListSelectItem<Content: View, SelectIndicator: View>: View {
Label("Item \(index)", systemImage: "\(index).circle")
}
}
#if os(iOS) || os(macOS) || os(visionOS)
.onTapGesture {
selection = index
}
#endif
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Pickers/ForEachMultiPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import SwiftUI
to get more control over the list item views. The view uses
the provided `listItem` to build an item view for each item.
*/
public struct ForEachMultiPicker<Item: Identifiable, ItemView: View>: View, DismissableView {
public struct ForEachMultiPicker<Item: Identifiable, ItemView: View>: View {

/// Create a for-each multi-picker.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Pickers/ForEachPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SwiftUI
If `dismissAfterPick` is `true` the picker dismisses itself
automatically when an item is picked.
*/
public struct ForEachPicker<Item: Identifiable, ItemView: View>: View, DismissableView {
public struct ForEachPicker<Item: Identifiable, ItemView: View>: View {

/// Create a for-each picker.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Pickers/ListMultiPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import SwiftUI
to get more control over the list item views. The view uses
the provided `listItem` to build an item view for each item.
*/
public struct ListMultiPicker<Item: Identifiable, ItemView: View>: View, DismissableView {
public struct ListMultiPicker<Item: Identifiable, ItemView: View>: View {

/// Create a list picker.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Pickers/ListPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SwiftUI
If `dismissAfterPick` is `true` the picker dismisses itself
automatically when an item is picked.
*/
public struct ListPicker<Item: Identifiable, ItemView: View>: View, DismissableView {
public struct ListPicker<Item: Identifiable, ItemView: View>: View {

/// Create a list picker.
///
Expand Down
3 changes: 1 addition & 2 deletions Sources/SwiftUIKit/Progress/LinearProgressBar+Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2022-2024 Daniel Saidi. All rights reserved.
//

#if os(iOS) || os(macOS) || os(tvOS)
#if os(iOS) || os(macOS) || os(tvOS) || os(visionOS)
import SwiftUI

public extension LinearProgressBar {
Expand Down Expand Up @@ -96,5 +96,4 @@ public extension EnvironmentValues {
set { self [LinearProgressBar.Style.Key.self] = newValue }
}
}

#endif
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Progress/LinearProgressBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2022-2024 Daniel Saidi. All rights reserved.
//

#if os(iOS) || os(macOS) || os(tvOS)
#if os(iOS) || os(macOS) || os(tvOS) || os(visionOS)
import SwiftUI

/**
Expand Down
Binary file modified Sources/SwiftUIKit/SwiftUIKit.docc/Resources/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Text/LinkText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private extension View {
func preferredFontWeight(
_ weight: Font.Weight
) -> some View {
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 8.0, *) {
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) {
self.fontWeight(weight)
} else {
self
Expand Down
11 changes: 0 additions & 11 deletions Sources/SwiftUIKit/Views/CustomRoundedRectangle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,6 @@ public struct CustomRoundedRectangle: Shape {
#Preview {

VStack {
if #available(iOS 16.0, *) {
UnevenRoundedRectangle(
cornerRadii: .init(
topLeading: 10,
bottomLeading: 20,
bottomTrailing: 30,
topTrailing: 40
)
)
}

CustomRoundedRectangle(
topLeft: 10,
topRight: 20,
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftUIKit/_Deprecated/Progress+Deprecated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public extension CircularProgressBar {
}
}

#if os(iOS) || os(macOS) || os(tvOS) || os(visionOS)
public extension LinearProgressBar {

@available(*, deprecated, message: "Custom styles must now be applied with .circularProgressBarStyle.")
Expand All @@ -24,7 +25,7 @@ public extension LinearProgressBar {
self.init(progress: progress)
}
}

#endif

@available(*, deprecated, message: "This is deprecated, use the new SwiftUI animations instead")
public extension Animation {
Expand Down

0 comments on commit 17c914c

Please sign in to comment.