diff --git a/README.md b/README.md index 62b1327..2181c34 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ targets: Basically there are two ways to mark your view as `Refreshable`.
- The easiest one is to add modifier `refreshable` to your view. + The easiest one is to add modifier refreshable to your view. ```swift import Refreshable @@ -84,7 +84,7 @@ struct YourView: View {
- Second one is to add manually `RefreshControl` to your view implementation. + Second one is to add manually RefreshControl to your view implementation. Don't forget to name your view’s coordinate space! @@ -110,6 +110,37 @@ struct YourView: View {
+
+ To control responsiveness for refreshable during scrolling use ScrollDistance. Or use defaults 😊. + + +```swift +import Refreshable + +struct Constants { + public static let isPad: Bool = UIDevice.current.userInterfaceIdiom == .pad +} + +struct YourView: View { + + var body: some View { + ScrollView { + RefreshControl(Constants.isPad ? .long : .short, // <= HERE + coordinateSpace: .named("List")) { + // do your work on refresh here + } + + LazyVStack { + ... + } + } + .coordinateSpace(name: "List") + } +} +``` + +
+ ## Communication - If you **found a bug**, open an issue or submit a fix via a pull request.