Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
25 lines
846 B
Swift
Executable File
25 lines
846 B
Swift
Executable File
// PullToRefresh — the app's one pull-to-refresh rule, so it lives here and not
|
|
// at every scroll view.
|
|
//
|
|
// Both platforms use RedWhiteUI's rwRefreshable: the house ring in the pulled
|
|
// gap instead of the system's gray spinner. On the Mac the pull is the
|
|
// trackpad's rubber-band past the top; the headers' ↻ buttons stay for a
|
|
// mouse, which has no rubber-band to pull with.
|
|
//
|
|
// Plain .refreshable is not a stand-in on macOS: since macOS 26 it answers a
|
|
// trackpad pull with the system's own gray spinner, which .tint cannot
|
|
// recolour.
|
|
|
|
import RedWhiteUI
|
|
import SwiftUI
|
|
|
|
extension View {
|
|
/// Pull-to-refresh in the house style. Use it where `.refreshable` would
|
|
/// go, on the `ScrollView`.
|
|
func pullToRefresh(
|
|
_ action: @escaping @MainActor @Sendable () async -> Void
|
|
) -> some View {
|
|
rwRefreshable(action)
|
|
}
|
|
}
|