Skip to content

Commit 7f11f2e

Browse files
Bump Xcode version (#6)
* Bump Xcode version and test on visionOS * Bump macOS version * Remove visionOS test
1 parent 61bf248 commit 7f11f2e

File tree

12 files changed

+33
-32
lines changed

12 files changed

+33
-32
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,37 @@ name: Build
22
on:
33
push:
44
branches:
5-
- 'main'
5+
- "main"
66
paths:
7-
- '.github/workflows/build.yml'
8-
- '**.swift'
7+
- ".github/workflows/build.yml"
8+
- "**.swift"
99
pull_request:
1010
paths:
11-
- '.github/workflows/build.yml'
12-
- '**.swift'
11+
- ".github/workflows/build.yml"
12+
- "**.swift"
1313
concurrency:
1414
group: build-${{ github.workflow }}-${{ github.ref }}
1515
cancel-in-progress: true
1616
jobs:
1717
build:
18-
runs-on: macos-13
18+
runs-on: macos-14
1919
name: Build ${{ matrix.destination.name }}
2020
strategy:
2121
matrix:
2222
destination:
2323
- name: macOS
2424
value: "platform=macOS,arch=x86_64"
25-
-
26-
name: iOS
25+
- name: iOS
2726
value: "platform=iOS Simulator,name=iPhone 14,OS=latest"
28-
-
29-
name: tvOS
27+
- name: tvOS
3028
value: "platform=tvOS Simulator,name=Apple TV,OS=latest"
31-
-
32-
name: watchOS
29+
- name: watchOS
3330
value: "platform=watchOS Simulator,name=Apple Watch Series 8 (41mm),OS=latest"
3431
steps:
3532
- uses: actions/checkout@v3
3633
- uses: maxim-lobanov/setup-xcode@v1
3734
with:
38-
xcode-version: '14.3.1'
35+
xcode-version: "15.0"
3936
- name: Build
4037
run: |-
4138
set -o pipefail && NSUnbufferedIO=YES xcodebuild clean build \

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Lint
22
on:
33
pull_request:
44
paths:
5-
- '.github/workflows/lint.yml'
6-
- '.swiftlint.yml'
7-
- '**/*.swift'
5+
- ".github/workflows/lint.yml"
6+
- ".swiftlint.yml"
7+
- "**/*.swift"
88
jobs:
99
lint:
1010
runs-on: ubuntu-latest

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2023 Ramon Torres
1+
Copyright (c) 2023-2024 Ramon Torres
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:5.9
22

33
import PackageDescription
44

@@ -9,7 +9,8 @@ let package = Package(
99
.macOS(.v11),
1010
.macCatalyst(.v14),
1111
.tvOS(.v14),
12-
.watchOS(.v7)
12+
.watchOS(.v7),
13+
.visionOS(.v1)
1314
],
1415
products: [
1516
.library(

Sources/SmoothGradient/CubicBezierCurve.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// CubicBezierCurve.swift
33
// SmoothGradient
44
//
5-
// Copyright (c) 2023 Ramon Torres
5+
// Copyright (c) 2023-2024 Ramon Torres
66
//
77
// This file is part of SmoothGradient which is released under the MIT license.
88
// See the LICENSE file in the root directory of this source tree for full details.
@@ -18,6 +18,7 @@ import SwiftUI
1818
@available(macOS, introduced: 11.0, deprecated: 14.0, message: "use UnitCurve instead")
1919
@available(tvOS, introduced: 14.0, deprecated: 17.0, message: "use UnitCurve instead")
2020
@available(watchOS, introduced: 7.0, deprecated: 10.0, message: "use UnitCurve instead")
21+
@available(visionOS, deprecated: 1.0, message: "use UnitCurve instead")
2122
public struct CubicBezierCurve: Curve {
2223
let p1: UnitPoint
2324
let p2: UnitPoint
@@ -63,9 +64,7 @@ public struct CubicBezierCurve: Curve {
6364
guard p1 != p2 else { return x }
6465
return sampleCurveY(getT(x: x))
6566
}
66-
}
6767

68-
extension CubicBezierCurve {
6968
private func getT(x: Double) -> Double {
7069
assert(x >= 0 && x <= 1, "x must be between 0 and 1")
7170

@@ -100,7 +99,8 @@ extension CubicBezierCurve {
10099

101100
// MARK: - Preview
102101

103-
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
102+
#if compiler(>=5.9)
103+
@available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *)
104104
struct CubicBezierCurve_Previews: PreviewProvider {
105105
static var previews: some View {
106106
Canvas(opaque: true) { context, size in
@@ -147,10 +147,11 @@ struct CubicBezierCurve_Previews: PreviewProvider {
147147
color: CGColor(red: 0, green: 1, blue: 0, alpha: 1),
148148
dashed: true
149149
) { progress in
150-
CubicBezierCurve.easeInOut.value(at: progress)
150+
UnitCurve.easeInOut.value(at: progress)
151151
}
152152
}
153153
}
154154
.frame(width: 400, height: 400)
155155
}
156156
}
157+
#endif

Sources/SmoothGradient/Curve.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Curve.swift
33
// SmoothGradient
44
//
5-
// Copyright (c) 2023 Ramon Torres
5+
// Copyright (c) 2023-2024 Ramon Torres
66
//
77
// This file is part of SmoothGradient which is released under the MIT license.
88
// See the LICENSE file in the root directory of this source tree for full details.

Sources/SmoothGradient/Gradient+Smooth.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Gradient+Smooth.swift
33
// SmoothGradient
44
//
5-
// Copyright (c) 2023 Ramon Torres
5+
// Copyright (c) 2023-2024 Ramon Torres
66
//
77
// This file is part of SmoothGradient which is released under the MIT license.
88
// See the LICENSE file in the root directory of this source tree for full details.
@@ -77,6 +77,7 @@ extension Gradient {
7777
@available(macOS, introduced: 11.0, deprecated: 14.0, renamed: "smooth(from:to:curve:steps:)")
7878
@available(tvOS, introduced: 14.0, deprecated: 17.0, renamed: "smooth(from:to:curve:steps:)")
7979
@available(watchOS, introduced: 7.0, deprecated: 10.0, renamed: "smooth(from:to:curve:steps:)")
80+
@available(visionOS, deprecated: 1.0, renamed: "smooth(from:to:curve:steps:)")
8081
@_disfavoredOverload
8182
public static func smooth(
8283
from: Color,
@@ -104,6 +105,7 @@ extension Gradient {
104105
@available(macOS, introduced: 11.0, deprecated: 14.0, renamed: "smooth(from:to:curve:steps:)")
105106
@available(tvOS, introduced: 14.0, deprecated: 17.0, renamed: "smooth(from:to:curve:steps:)")
106107
@available(watchOS, introduced: 7.0, deprecated: 10.0, renamed: "smooth(from:to:curve:steps:)")
108+
@available(visionOS, deprecated: 1.0, renamed: "smooth(from:to:curve:steps:)")
107109
@_disfavoredOverload
108110
public static func smooth(
109111
from: Stop,

Sources/SmoothGradient/GradientInterpolator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// GradientInterpolator.swift
33
// SmoothGradient
44
//
5-
// Copyright (c) 2023 Ramon Torres
5+
// Copyright (c) 2023-2024 Ramon Torres
66
//
77
// This file is part of SmoothGradient which is released under the MIT license.
88
// See the LICENSE file in the root directory of this source tree for full details.
@@ -71,7 +71,7 @@ extension GradientInterpolator {
7171
// the block and return the transformed color.
7272
return block()
7373
#else
74-
// iOS, iPadOS, Mac Catalyst, and tvOS
74+
// iOS, iPadOS, Mac Catalyst, tvOS, and visionOS.
7575
return PlatformColor { _ in block() }
7676
#endif
7777
#else

Sources/SmoothGradient/SmoothLinearGradient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SmoothLinearGradient.swift
33
// SmoothGradientTests
44
//
5-
// Copyright (c) 2023 Ramon Torres
5+
// Copyright (c) 2023-2024 Ramon Torres
66
//
77
// This file is part of SmoothGradient which is released under the MIT license.
88
// See the LICENSE file in the root directory of this source tree for full details.

Tests/SmoothGradientTests/CubicBezierCurveTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// CubicBezierCurveTests.swift
33
// SmoothGradientTests
44
//
5-
// Copyright (c) 2023 Ramon Torres
5+
// Copyright (c) 2023-2024 Ramon Torres
66
//
77
// This file is part of SmoothGradient which is released under the MIT license.
88
// See the LICENSE file in the root directory of this source tree for full details.

0 commit comments

Comments
 (0)