From f456746c7c363af4b4b3ca236490c7fc0c7b9e87 Mon Sep 17 00:00:00 2001 From: Laszlo Teveli Date: Mon, 8 Jul 2024 18:07:05 +0200 Subject: [PATCH] Bump deployment target --- Package.swift | 8 ++++---- Sources/Flow/Example/ContentView.swift | 3 --- Sources/Flow/HFlow.swift | 3 --- Sources/Flow/HFlowLayout.swift | 2 -- Sources/Flow/Internal/Layout.swift | 3 --- Sources/Flow/Internal/Protocols.swift | 4 ---- Sources/Flow/Internal/Size.swift | 1 - Sources/Flow/Support.swift | 2 -- Sources/Flow/VFlow.swift | 3 --- Sources/Flow/VFlowLayout.swift | 2 -- Tests/FlowTests/FlowTests.swift | 1 - Tests/FlowTests/Utils/TestSubview.swift | 4 ---- 12 files changed, 4 insertions(+), 32 deletions(-) diff --git a/Package.swift b/Package.swift index 02b2443a..c981b8e4 100644 --- a/Package.swift +++ b/Package.swift @@ -5,10 +5,10 @@ import PackageDescription let package = Package( name: "Flow", platforms: [ - .iOS(.v15), - .macOS(.v12), - .tvOS(.v15), - .watchOS(.v8) + .iOS(.v16), + .macOS(.v13), + .tvOS(.v16), + .watchOS(.v9) ], products: [ .library(name: "Flow", targets: ["Flow"]) diff --git a/Sources/Flow/Example/ContentView.swift b/Sources/Flow/Example/ContentView.swift index f3d48eec..f13c0ee2 100644 --- a/Sources/Flow/Example/ContentView.swift +++ b/Sources/Flow/Example/ContentView.swift @@ -1,6 +1,5 @@ import SwiftUI -@available(macOS 13.0, *) struct ContentView: View { @State private var axis: Axis = .horizontal @State private var contents: Contents = .boxes @@ -161,7 +160,6 @@ enum Contents: String, CustomStringConvertible, CaseIterable { var description: String { rawValue } } -@available(macOS 13.0, *) enum Justified: String, CustomStringConvertible, CaseIterable { case none = "no justification" case stretchItems = "stretch items" @@ -180,7 +178,6 @@ enum Justified: String, CustomStringConvertible, CaseIterable { } } -@available(macOS 13.0, *) #Preview { ContentView() } diff --git a/Sources/Flow/HFlow.swift b/Sources/Flow/HFlow.swift index 115675a3..d0dbddb5 100644 --- a/Sources/Flow/HFlow.swift +++ b/Sources/Flow/HFlow.swift @@ -18,7 +18,6 @@ import SwiftUI /// } /// } /// -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) @frozen public struct HFlow: View { @usableFromInline @@ -99,12 +98,10 @@ public struct HFlow: View { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension HFlow: Animatable where Content == EmptyView { public typealias AnimatableData = EmptyAnimatableData } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension HFlow: Layout where Content == EmptyView { /// Creates a horizontal flow with the given spacing and vertical alignment. /// diff --git a/Sources/Flow/HFlowLayout.swift b/Sources/Flow/HFlowLayout.swift index a7ec6767..92ba5af9 100644 --- a/Sources/Flow/HFlowLayout.swift +++ b/Sources/Flow/HFlowLayout.swift @@ -1,7 +1,6 @@ import SwiftUI /// A layout that arranges its children in a horizontally flowing manner. -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) @frozen public struct HFlowLayout { @usableFromInline @@ -37,7 +36,6 @@ public struct HFlowLayout { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension HFlowLayout: Layout { @inlinable public func sizeThatFits(proposal: ProposedViewSize, subviews: LayoutSubviews, cache: inout FlowLayoutCache) -> CGSize { diff --git a/Sources/Flow/Internal/Layout.swift b/Sources/Flow/Internal/Layout.swift index 24b7abba..07a8ab6f 100644 --- a/Sources/Flow/Internal/Layout.swift +++ b/Sources/Flow/Internal/Layout.swift @@ -1,7 +1,6 @@ import CoreFoundation import SwiftUI -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) @usableFromInline struct FlowLayout { let axis: Axis @@ -235,7 +234,6 @@ struct FlowLayout { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension FlowLayout: Layout { @usableFromInline func makeCache(subviews: LayoutSubviews) -> FlowLayoutCache { @@ -297,7 +295,6 @@ extension Array where Element == Size { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) private struct SubviewProperties { var indexInLine: Int var spacing: Double diff --git a/Sources/Flow/Internal/Protocols.swift b/Sources/Flow/Internal/Protocols.swift index 62b6f1e1..66a1c0b0 100644 --- a/Sources/Flow/Internal/Protocols.swift +++ b/Sources/Flow/Internal/Protocols.swift @@ -1,13 +1,10 @@ import SwiftUI -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) @usableFromInline protocol Subviews: RandomAccessCollection where Element: Subview, Index == Int {} -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension LayoutSubviews: Subviews {} -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) @usableFromInline protocol Subview { var spacing: ViewSpacing { get } @@ -17,7 +14,6 @@ protocol Subview { func place(at position: CGPoint, anchor: UnitPoint, proposal: ProposedViewSize) } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension LayoutSubview: Subview { @usableFromInline func dimensions(_ proposal: ProposedViewSize) -> Dimensions { diff --git a/Sources/Flow/Internal/Size.swift b/Sources/Flow/Internal/Size.swift index 08a6f8a7..445f6299 100644 --- a/Sources/Flow/Internal/Size.swift +++ b/Sources/Flow/Internal/Size.swift @@ -103,7 +103,6 @@ extension CGSize: FixedOrientation2DCoordinate { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension ProposedViewSize: FixedOrientation2DCoordinate { @inlinable init(size: Size, axis: Axis) { diff --git a/Sources/Flow/Support.swift b/Sources/Flow/Support.swift index 4bce3975..22cc8d61 100644 --- a/Sources/Flow/Support.swift +++ b/Sources/Flow/Support.swift @@ -1,7 +1,6 @@ import SwiftUI /// Justified layout stretches lines in a way to create a straight and even edge on both sides of the view -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) public enum Justification { /// Flexible items are stretched proportionally in each line case stretchItems @@ -30,7 +29,6 @@ public enum Justification { /// Cache to store certain properties of subviews in the layout (flexibility, spacing preferences, layout priority). /// Even though it needs to be public (because it's part of the layout protocol conformance), /// it's considered an internal implementation detail. -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) public struct FlowLayoutCache { @usableFromInline struct SubviewCache { diff --git a/Sources/Flow/VFlow.swift b/Sources/Flow/VFlow.swift index 36e6df2d..aaa28c03 100644 --- a/Sources/Flow/VFlow.swift +++ b/Sources/Flow/VFlow.swift @@ -18,7 +18,6 @@ import SwiftUI /// } /// } /// -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) @frozen public struct VFlow: View { @usableFromInline @@ -98,12 +97,10 @@ public struct VFlow: View { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension VFlow: Animatable where Content == EmptyView { public typealias AnimatableData = EmptyAnimatableData } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension VFlow: Layout where Content == EmptyView { /// Creates a vertical flow with the given spacing and horizontal alignment. /// diff --git a/Sources/Flow/VFlowLayout.swift b/Sources/Flow/VFlowLayout.swift index d1df0b0e..e5383475 100644 --- a/Sources/Flow/VFlowLayout.swift +++ b/Sources/Flow/VFlowLayout.swift @@ -1,7 +1,6 @@ import SwiftUI /// A layout that arranges its children in a vertically flowing manner. -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) @frozen public struct VFlowLayout { @usableFromInline @@ -39,7 +38,6 @@ public struct VFlowLayout { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension VFlowLayout: Layout { @inlinable public func sizeThatFits( diff --git a/Tests/FlowTests/FlowTests.swift b/Tests/FlowTests/FlowTests.swift index b638e41d..8bb623ad 100644 --- a/Tests/FlowTests/FlowTests.swift +++ b/Tests/FlowTests/FlowTests.swift @@ -2,7 +2,6 @@ import SwiftUI import XCTest @testable import Flow -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) final class FlowTests: XCTestCase { func test_HFlow_size_singleElement() throws { // Given diff --git a/Tests/FlowTests/Utils/TestSubview.swift b/Tests/FlowTests/Utils/TestSubview.swift index 996496bc..f53aa408 100644 --- a/Tests/FlowTests/Utils/TestSubview.swift +++ b/Tests/FlowTests/Utils/TestSubview.swift @@ -2,7 +2,6 @@ import SwiftUI import XCTest @testable import Flow -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) final class TestSubview: Subview, CustomStringConvertible { var spacing = ViewSpacing() var priority: Double = 1 @@ -59,12 +58,10 @@ final class TestSubview: Subview, CustomStringConvertible { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension [TestSubview]: Subviews {} typealias LayoutDescription = (subviews: [TestSubview], reportedSize: CGSize) -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) extension FlowLayout { func layout(_ subviews: [TestSubview], in bounds: CGSize) -> LayoutDescription { var cache = makeCache(subviews) @@ -91,7 +88,6 @@ extension FlowLayout { } } -@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) func render(_ layout: LayoutDescription, border: Bool = true) -> String { struct Point: Hashable { let x, y: Int