diff options
| author | Fuwn <[email protected]> | 2025-07-11 06:32:46 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-07-11 06:32:46 -0700 |
| commit | 2e079945cb3c68ed05750757b59f0acc59155010 (patch) | |
| tree | 23901f3b5ef4956f7983bccc2922b9b9378dfcbb /Sora/Data/Scroll/ScrollPositionPreferenceKey.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-2e079945cb3c68ed05750757b59f0acc59155010.tar.xz sora-testing-2e079945cb3c68ed05750757b59f0acc59155010.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Data/Scroll/ScrollPositionPreferenceKey.swift')
| -rw-r--r-- | Sora/Data/Scroll/ScrollPositionPreferenceKey.swift | 19 |
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 - } - } -} |