Skip to content

Commit

Permalink
Bump to Swift 5.9 (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
davdroman authored Jul 19, 2024
1 parent ad6ecab commit ddc7d42
Show file tree
Hide file tree
Showing 25 changed files with 45 additions and 48 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- "**"
schedule:
- cron: '3 3 * * 2' # 3:03 AM, every Tuesday
- cron: "3 3 * * 2" # 3:03 AM, every Tuesday

concurrency:
group: ci-${{ github.ref }}
Expand All @@ -17,7 +17,7 @@ concurrency:
jobs:
macOS:
name: ${{ matrix.platform }} (Swift ${{ matrix.swift }})
runs-on: macos-13
runs-on: macos-14
strategy:
fail-fast: false
matrix:
Expand All @@ -26,9 +26,8 @@ jobs:
- mac-catalyst
- tvOS
swift:
- 5.7
- 5.8
- 5.9
- "5.9"
- "5.10"
steps:
- name: Git Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version: 5.9

import PackageDescription

Expand Down
4 changes: 2 additions & 2 deletions Sources/Animation/Animation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import UIKit
public struct Animation {
static var defaultDuration: Double { 0.35 }

@_spi(package) public var duration: Double
@_spi(package) public let timingParameters: UITimingCurveProvider
package var duration: Double
package let timingParameters: UITimingCurveProvider

init(duration: Double, timingParameters: UITimingCurveProvider) {
self.duration = duration
Expand Down
8 changes: 4 additions & 4 deletions Sources/Animator/AnimatorTransientView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,29 @@ public class AnimatorTransientView {
/// Note: these changes are *not* animated.
public var completion: Properties

@_spi(package) public let uiView: UIView
package let uiView: UIView

/// Read-only proxy to underlying `UIView` properties.
public subscript<T>(dynamicMember keyPath: KeyPath<UIView, T>) -> T {
uiView[keyPath: keyPath]
}

@_spi(package) public init(_ uiView: UIView) {
package init(_ uiView: UIView) {
self.initial = Properties(of: uiView)
self.animation = Properties(of: uiView)
self.completion = Properties(of: uiView)

self.uiView = uiView
}

@_spi(package) public func setUIViewProperties(
package func setUIViewProperties(
to properties: KeyPath<AnimatorTransientView, Properties>,
force: Bool = false
) {
self[keyPath: properties].assignToUIView(uiView, force: force)
}

@_spi(package) public func resetUIViewProperties() {
package func resetUIViewProperties() {
Properties.default.assignToUIView(uiView, force: true)
}
}
1 change: 0 additions & 1 deletion Sources/Animator/Transform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ extension CATransform3D {
}
}

@_spi(package)
extension CATransform3D: Equatable {
@inlinable
public static func == (lhs: Self, rhs: Self) -> Bool {
Expand Down
2 changes: 1 addition & 1 deletion Sources/AtomicTransition/Rotate3D.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) import Animator
import Animator
import SwiftUI

/// A transition that rotates the view from `angle` to zero on insertion, and from zero to `angle` on removal.
Expand Down
2 changes: 1 addition & 1 deletion Sources/AtomicTransition/ZPosition.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) import Animator
import Animator
import UIKit

/// A transition that changes the view layer’s position on the z axis.
Expand Down
12 changes: 6 additions & 6 deletions Sources/NavigationTransition/AnyNavigationTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ import Animation
import UIKit

public struct AnyNavigationTransition {
@_spi(package) public typealias TransientHandler = (
package typealias TransientHandler = (
AnimatorTransientView,
AnimatorTransientView,
NavigationTransitionOperation,
UIView
) -> Void

@_spi(package) public typealias PrimitiveHandler = (
package typealias PrimitiveHandler = (
Animator,
NavigationTransitionOperation,
UIViewControllerContextTransitioning
) -> Void

@_spi(package) public enum Handler {
package enum Handler {
case transient(TransientHandler)
case primitive(PrimitiveHandler)
}

@_spi(package) public let isDefault: Bool
@_spi(package) public let handler: Handler
@_spi(package) public var animation: Animation? = .default
package let isDefault: Bool
package let handler: Handler
package var animation: Animation? = .default

public init(_ transition: some NavigationTransition) {
self.isDefault = false
Expand Down
4 changes: 2 additions & 2 deletions Sources/NavigationTransition/Default.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ extension AnyNavigationTransition {
}
}

@_spi(package) public struct Default: PrimitiveNavigationTransition {
package struct Default: PrimitiveNavigationTransition {
init() {}

public func transition(with animator: Animator, for operation: TransitionOperation, in context: Context) {
package func transition(with animator: Animator, for operation: TransitionOperation, in context: Context) {
// NO-OP
}
}
2 changes: 1 addition & 1 deletion Sources/NavigationTransition/NavigationTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public enum NavigationTransitionOperation: Hashable {
case push
case pop

@_spi(package) public init?(_ operation: UINavigationController.Operation) {
package init?(_ operation: UINavigationController.Operation) {
switch operation {
case .push:
self = .push
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) import NavigationTransition
import NavigationTransition
import RuntimeAssociation
import RuntimeSwizzling
import UIKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@_spi(package) import Animation
@_spi(package) import Animator
@_spi(package) import NavigationTransition
import Animation
import Animator
import NavigationTransition
import UIKit

final class NavigationTransitionDelegate: NSObject, UINavigationControllerDelegate {
Expand Down
2 changes: 1 addition & 1 deletion Sources/TestUtils/AnimatorTransientView+Mocks.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) @testable import Animator
@testable import Animator
import UIKit
import XCTestDynamicOverlay

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) @testable import Animator
@testable import Animator
import TestUtils

final class AnimatorTransientViewPropertiesTests: XCTestCase {}
Expand Down
2 changes: 1 addition & 1 deletion Tests/AnimatorTests/AnimatorTransientViewTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) @testable import Animator
@testable import Animator
import TestUtils

final class AnimatorTransientViewTests: XCTestCase {}
Expand Down
2 changes: 1 addition & 1 deletion Tests/AtomicTransitionTests/CombinedTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) @testable import AtomicTransition
@testable import AtomicTransition
import TestUtils

final class CombinedTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AtomicTransitionTests/GroupTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) import AtomicTransition
import AtomicTransition
import TestUtils

final class GroupTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AtomicTransitionTests/IdentityTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) import AtomicTransition
import AtomicTransition
import TestUtils

final class IdentityTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicTransitionTests/MoveTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@_spi(package) @testable import Animator
@_spi(package) import AtomicTransition
@testable import Animator
import AtomicTransition
import TestUtils

final class MoveTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicTransitionTests/OffsetTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@_spi(package) @testable import Animator
@_spi(package) import AtomicTransition
@testable import Animator
import AtomicTransition
import TestUtils

final class OffsetTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AtomicTransitionTests/OnTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_spi(package) import AtomicTransition
import AtomicTransition
import TestUtils

final class OnInsertionTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicTransitionTests/OpacityTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@_spi(package) @testable import Animator
@_spi(package) import AtomicTransition
@testable import Animator
import AtomicTransition
import TestUtils

final class OpacityTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicTransitionTests/RotateTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@_spi(package) @testable import Animator
@_spi(package) import AtomicTransition
@testable import Animator
import AtomicTransition
import TestUtils

final class RotateTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicTransitionTests/ScaleTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@_spi(package) @testable import Animator
@_spi(package) import AtomicTransition
@testable import Animator
import AtomicTransition
import TestUtils

final class ScaleTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions Tests/AtomicTransitionTests/ZPositionTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@_spi(package) @testable import Animator
@_spi(package) import AtomicTransition
@testable import Animator
import AtomicTransition
import TestUtils

final class ZPositionTests: XCTestCase {
Expand Down

0 comments on commit ddc7d42

Please sign in to comment.