Skip to content

Commit 3c23bd9

Browse files
committed
Fix hash availability of Animation.
1 parent 3c97f72 commit 3c23bd9

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

Sources/SharingGRDBCore/Fetch.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ extension Fetch: Equatable where Value: Equatable {
164164
/// (`@Dependency(\.defaultDatabase)`).
165165
/// - animation: The animation to use for user interface changes that result from changes to
166166
/// the fetched results.
167+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
167168
public init(
168169
wrappedValue: Value,
169170
_ request: some FetchKeyRequest<Value>,
@@ -184,6 +185,7 @@ extension Fetch: Equatable where Value: Equatable {
184185
/// (`@Dependency(\.defaultDatabase)`).
185186
/// - animation: The animation to use for user interface changes that result from changes to
186187
/// the fetched results.
188+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
187189
public func load(
188190
_ request: some FetchKeyRequest<Value>,
189191
database: (any DatabaseReader)? = nil,

Sources/SharingGRDBCore/FetchAll.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ extension FetchAll: Equatable where Element: Equatable {
364364
/// (`@Dependency(\.defaultDatabase)`).
365365
/// - animation: The animation to use for user interface changes that result from changes to
366366
/// the fetched results.
367+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
367368
public init(
368369
wrappedValue: [Element] = [],
369370
database: (any DatabaseReader)? = nil,
@@ -381,6 +382,7 @@ extension FetchAll: Equatable where Element: Equatable {
381382
/// (`@Dependency(\.defaultDatabase)`).
382383
/// - animation: The animation to use for user interface changes that result from changes to
383384
/// the fetched results.
385+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
384386
public init<S: SelectStatement>(
385387
wrappedValue: [Element] = [],
386388
_ statement: S,
@@ -409,6 +411,7 @@ extension FetchAll: Equatable where Element: Equatable {
409411
/// (`@Dependency(\.defaultDatabase)`).
410412
/// - animation: The animation to use for user interface changes that result from changes to
411413
/// the fetched results.
414+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
412415
public init<V: QueryRepresentable>(
413416
wrappedValue: [Element] = [],
414417
_ statement: some StructuredQueriesCore.Statement<V>,
@@ -435,6 +438,7 @@ extension FetchAll: Equatable where Element: Equatable {
435438
/// (`@Dependency(\.defaultDatabase)`).
436439
/// - animation: The animation to use for user interface changes that result from changes to
437440
/// the fetched results.
441+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
438442
public init<S: StructuredQueriesCore.Statement<Element>>(
439443
wrappedValue: [Element] = [],
440444
_ statement: S,
@@ -461,6 +465,7 @@ extension FetchAll: Equatable where Element: Equatable {
461465
/// (`@Dependency(\.defaultDatabase)`).
462466
/// - animation: The animation to use for user interface changes that result from changes to
463467
/// the fetched results.
468+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
464469
public func load<S: SelectStatement>(
465470
_ statement: S,
466471
database: (any DatabaseReader)? = nil,
@@ -484,6 +489,7 @@ extension FetchAll: Equatable where Element: Equatable {
484489
/// (`@Dependency(\.defaultDatabase)`).
485490
/// - animation: The animation to use for user interface changes that result from changes to
486491
/// the fetched results.
492+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
487493
public func load<V: QueryRepresentable>(
488494
_ statement: some StructuredQueriesCore.Statement<V>,
489495
database: (any DatabaseReader)? = nil,

Sources/SharingGRDBCore/FetchKey+SwiftUI.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
@available(macOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
1919
@available(tvOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
2020
@available(watchOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
21+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
2122
public static func fetch<Value>(
2223
_ request: some FetchKeyRequest<Value>,
2324
database: (any DatabaseReader)? = nil,
@@ -41,6 +42,7 @@
4142
@available(macOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
4243
@available(tvOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
4344
@available(watchOS, deprecated: 9999, message: "Use the '@Fetch' property wrapper, instead")
45+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
4446
public static func fetch<Records: RangeReplaceableCollection>(
4547
_ request: some FetchKeyRequest<Records>,
4648
database: (any DatabaseReader)? = nil,
@@ -65,6 +67,7 @@
6567
@available(macOS, deprecated: 9999, message: "Use '@FetchAll' and '#sql', instead")
6668
@available(tvOS, deprecated: 9999, message: "Use '@FetchAll' and '#sql', instead")
6769
@available(watchOS, deprecated: 9999, message: "Use '@FetchAll' and '#sql', instead")
70+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
6871
public static func fetchAll<Record: FetchableRecord>(
6972
sql: String,
7073
arguments: StatementArguments = StatementArguments(),
@@ -95,6 +98,7 @@
9598
@available(macOS, deprecated: 9999, message: "Use '@FetchOne' and '#sql', instead")
9699
@available(tvOS, deprecated: 9999, message: "Use '@FetchOne' and '#sql', instead")
97100
@available(watchOS, deprecated: 9999, message: "Use '@FetchOne' and '#sql', instead")
101+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
98102
public static func fetchOne<Value: DatabaseValueConvertible>(
99103
sql: String,
100104
arguments: StatementArguments = StatementArguments(),
@@ -111,7 +115,7 @@
111115
}
112116
}
113117

114-
package struct AnimatedScheduler: ValueObservationScheduler, Hashable {
118+
package struct AnimatedScheduler: ValueObservationScheduler, Equatable {
115119
let animation: Animation
116120
package func immediateInitialValue() -> Bool { true }
117121
package func schedule(_ action: @escaping @Sendable () -> Void) {
@@ -123,6 +127,9 @@
123127
}
124128
}
125129

130+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
131+
extension AnimatedScheduler: Hashable {}
132+
126133
extension ValueObservationScheduler where Self == AnimatedScheduler {
127134
package static func animation(_ animation: Animation) -> Self {
128135
AnimatedScheduler(animation: animation)

Sources/SharingGRDBCore/FetchOne.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ extension FetchOne: Equatable where Value: Equatable {
834834
/// (`@Dependency(\.defaultDatabase)`).
835835
/// - animation: The animation to use for user interface changes that result from changes to
836836
/// the fetched results.
837+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
837838
public init(
838839
wrappedValue: sending Value,
839840
database: (any DatabaseReader)? = nil,
@@ -853,6 +854,7 @@ extension FetchOne: Equatable where Value: Equatable {
853854
/// (`@Dependency(\.defaultDatabase)`).
854855
/// - animation: The animation to use for user interface changes that result from changes to
855856
/// the fetched results.
857+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
856858
public init(
857859
wrappedValue: sending Value,
858860
database: (any DatabaseReader)? = nil,
@@ -875,6 +877,7 @@ extension FetchOne: Equatable where Value: Equatable {
875877
/// (`@Dependency(\.defaultDatabase)`).
876878
/// - animation: The animation to use for user interface changes that result from changes to
877879
/// the fetched results.
880+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
878881
public init<S: SelectStatement>(
879882
wrappedValue: Value,
880883
_ statement: S,
@@ -903,6 +906,7 @@ extension FetchOne: Equatable where Value: Equatable {
903906
/// (`@Dependency(\.defaultDatabase)`).
904907
/// - animation: The animation to use for user interface changes that result from changes to
905908
/// the fetched results.
909+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
906910
public init<V: QueryRepresentable>(
907911
wrappedValue: Value,
908912
_ statement: some StructuredQueriesCore.Statement<V>,
@@ -929,6 +933,7 @@ extension FetchOne: Equatable where Value: Equatable {
929933
/// (`@Dependency(\.defaultDatabase)`).
930934
/// - animation: The animation to use for user interface changes that result from changes to
931935
/// the fetched results.
936+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
932937
public init<V: QueryRepresentable>(
933938
wrappedValue: Value = nil,
934939
_ statement: some StructuredQueriesCore.Statement<V>,
@@ -955,6 +960,7 @@ extension FetchOne: Equatable where Value: Equatable {
955960
/// (`@Dependency(\.defaultDatabase)`).
956961
/// - animation: The animation to use for user interface changes that result from changes to
957962
/// the fetched results.
963+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
958964
public init<S: StructuredQueriesCore.Statement<Value>>(
959965
wrappedValue: Value,
960966
_ statement: S,
@@ -982,6 +988,7 @@ extension FetchOne: Equatable where Value: Equatable {
982988
/// (`@Dependency(\.defaultDatabase)`).
983989
/// - animation: The animation to use for user interface changes that result from changes to
984990
/// the fetched results.
991+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
985992
public init<S: SelectStatement>(
986993
wrappedValue: Value = ._none,
987994
_ statement: S,
@@ -1011,6 +1018,7 @@ extension FetchOne: Equatable where Value: Equatable {
10111018
/// (`@Dependency(\.defaultDatabase)`).
10121019
/// - animation: The animation to use for user interface changes that result from changes to
10131020
/// the fetched results.
1021+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
10141022
public init<S: StructuredQueriesCore.Statement>(
10151023
wrappedValue: Value = ._none,
10161024
_ statement: S,
@@ -1040,6 +1048,7 @@ extension FetchOne: Equatable where Value: Equatable {
10401048
/// (`@Dependency(\.defaultDatabase)`).
10411049
/// - animation: The animation to use for user interface changes that result from changes to
10421050
/// the fetched results.
1051+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
10431052
public init(
10441053
wrappedValue: Value = ._none,
10451054
_ statement: some StructuredQueriesCore.Statement<Value>,
@@ -1067,6 +1076,7 @@ extension FetchOne: Equatable where Value: Equatable {
10671076
/// (`@Dependency(\.defaultDatabase)`).
10681077
/// - animation: The animation to use for user interface changes that result from changes to
10691078
/// the fetched results.
1079+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
10701080
public func load<S: SelectStatement>(
10711081
_ statement: S,
10721082
database: (any DatabaseReader)? = nil,
@@ -1088,6 +1098,7 @@ extension FetchOne: Equatable where Value: Equatable {
10881098
/// (`@Dependency(\.defaultDatabase)`).
10891099
/// - animation: The animation to use for user interface changes that result from changes to
10901100
/// the fetched results.
1101+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
10911102
public func load<V: QueryRepresentable>(
10921103
_ statement: some StructuredQueriesCore.Statement<V>,
10931104
database: (any DatabaseReader)? = nil,
@@ -1107,6 +1118,7 @@ extension FetchOne: Equatable where Value: Equatable {
11071118
/// (`@Dependency(\.defaultDatabase)`).
11081119
/// - animation: The animation to use for user interface changes that result from changes to
11091120
/// the fetched results.
1121+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
11101122
public func load<V: QueryRepresentable>(
11111123
_ statement: some StructuredQueriesCore.Statement<V>,
11121124
database: (any DatabaseReader)? = nil,
@@ -1126,6 +1138,7 @@ extension FetchOne: Equatable where Value: Equatable {
11261138
/// (`@Dependency(\.defaultDatabase)`).
11271139
/// - animation: The animation to use for user interface changes that result from changes to
11281140
/// the fetched results.
1141+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
11291142
public func load<S: SelectStatement>(
11301143
_ statement: S,
11311144
database: (any DatabaseReader)? = nil,
@@ -1148,6 +1161,7 @@ extension FetchOne: Equatable where Value: Equatable {
11481161
/// (`@Dependency(\.defaultDatabase)`).
11491162
/// - animation: The animation to use for user interface changes that result from changes to
11501163
/// the fetched results.
1164+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
11511165
public func load<S: StructuredQueriesCore.Statement>(
11521166
_ statement: S,
11531167
database: (any DatabaseReader)? = nil,
@@ -1170,6 +1184,7 @@ extension FetchOne: Equatable where Value: Equatable {
11701184
/// (`@Dependency(\.defaultDatabase)`).
11711185
/// - animation: The animation to use for user interface changes that result from changes to
11721186
/// the fetched results.
1187+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
11731188
public func load(
11741189
_ statement: some StructuredQueriesCore.Statement<Value>,
11751190
database: (any DatabaseReader)? = nil,

0 commit comments

Comments
 (0)