summaryrefslogtreecommitdiff
path: root/Sora/Data/Scroll/ScrollPositionPreferenceKey.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Sora/Data/Scroll/ScrollPositionPreferenceKey.swift')
-rw-r--r--Sora/Data/Scroll/ScrollPositionPreferenceKey.swift19
1 files changed, 0 insertions, 19 deletions
diff --git a/Sora/Data/Scroll/ScrollPositionPreferenceKey.swift b/Sora/Data/Scroll/ScrollPositionPreferenceKey.swift
deleted file mode 100644
index 6b78bdc..0000000
--- a/Sora/Data/Scroll/ScrollPositionPreferenceKey.swift
+++ /dev/null
@@ -1,19 +0,0 @@
-import SwiftUI
-
-struct ScrollPositionPreferenceKey: PreferenceKey {
- typealias Value = ScrollPositionPreference?
-
- static var defaultValue: Value = nil
-
- static func reduce(value: inout Value, nextValue: () -> Value) {
- guard let next = nextValue() else { return }
-
- if let current = value {
- if abs(next.yPosition) < abs(current.yPosition) {
- value = next
- }
- } else {
- value = next
- }
- }
-}