Skip to content

Commit

Permalink
Bump deployment target
Browse files Browse the repository at this point in the history
  • Loading branch information
tevelee committed Jul 8, 2024
1 parent 733c317 commit f456746
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 32 deletions.
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
3 changes: 0 additions & 3 deletions Sources/Flow/Example/ContentView.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -180,7 +178,6 @@ enum Justified: String, CustomStringConvertible, CaseIterable {
}
}

@available(macOS 13.0, *)
#Preview {
ContentView()
}
3 changes: 0 additions & 3 deletions Sources/Flow/HFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import SwiftUI
/// }
/// }
///
@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)
@frozen
public struct HFlow<Content: View>: View {
@usableFromInline
Expand Down Expand Up @@ -99,12 +98,10 @@ public struct HFlow<Content: View>: 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.
///
Expand Down
2 changes: 0 additions & 2 deletions Sources/Flow/HFlowLayout.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions Sources/Flow/Internal/Layout.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions Sources/Flow/Internal/Protocols.swift
Original file line number Diff line number Diff line change
@@ -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 }
Expand All @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion Sources/Flow/Internal/Size.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions Sources/Flow/Support.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions Sources/Flow/VFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import SwiftUI
/// }
/// }
///
@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)
@frozen
public struct VFlow<Content: View>: View {
@usableFromInline
Expand Down Expand Up @@ -98,12 +97,10 @@ public struct VFlow<Content: View>: 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.
///
Expand Down
2 changes: 0 additions & 2 deletions Sources/Flow/VFlowLayout.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion Tests/FlowTests/FlowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions Tests/FlowTests/Utils/TestSubview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit f456746

Please sign in to comment.