Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make UIKitAnimations' frameworks property public via SPI #272

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Sources/UIKitNavigation/UIKitAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/// The way a view changes over time to create a smooth visual transition from one state to
/// another.
public struct UIKitAnimation: Hashable, Sendable {
fileprivate let framework: Framework
@_spi(Internals) public let framework: Framework

@MainActor
func perform<Result>(
Expand Down Expand Up @@ -115,19 +115,19 @@
}
}

fileprivate enum Framework: Hashable, Sendable {
@_spi(Internals) public enum Framework: Hashable, Sendable {
case uiKit(UIKit)
case swiftUI(Animation)

fileprivate struct UIKit: Hashable, Sendable {
fileprivate var delay: TimeInterval
fileprivate var duration: TimeInterval
fileprivate var options: UIView.AnimationOptions
fileprivate var repeatModifier: RepeatModifier?
fileprivate var speed: Double = 1
fileprivate var style: Style
@_spi(Internals) public struct UIKit: Hashable, Sendable {
@_spi(Internals) public var delay: TimeInterval
@_spi(Internals) public var duration: TimeInterval
@_spi(Internals) public var options: UIView.AnimationOptions
@_spi(Internals) public var repeatModifier: RepeatModifier?
@_spi(Internals) public var speed: Double = 1
@_spi(Internals) public var style: Style

func hash(into hasher: inout Hasher) {
@_spi(Internals) public func hash(into hasher: inout Hasher) {
hasher.combine(delay)
hasher.combine(duration)
hasher.combine(options.rawValue)
Expand All @@ -136,12 +136,12 @@
hasher.combine(style)
}

fileprivate struct RepeatModifier: Hashable, Sendable {
@_spi(Internals) public struct RepeatModifier: Hashable, Sendable {
var autoreverses = true
var count: CGFloat = 1
}

fileprivate enum Style: Hashable, Sendable {
@_spi(Internals) public enum Style: Hashable, Sendable {
case iOS4
case iOS7(dampingRatio: CGFloat, velocity: CGFloat)
case iOS17(bounce: CGFloat = 0, initialSpringVelocity: CGFloat = 0)
Expand Down