Skip to content

Nayzus/NativeRefresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Parshutkin Pavel
Oct 22, 2023
53b2477 · Oct 22, 2023

History

32 Commits
Aug 8, 2022
Oct 22, 2023
Oct 22, 2023
Aug 8, 2022
Aug 4, 2022
Aug 12, 2022
Aug 4, 2022

Repository files navigation

NativeRefresh

Native SwiftUI Pool to Refresh

drawing

Installation

Ready for use on iOS 13+.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Once you have your Swift package set up, adding as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/Nayzus/NativeRefresh", .upToNextMajor(from: "1.0.0"))
]

Quick Start

To start, you need to import the package import NativeRefresh

            RefreshableScrollView {
                YourContent()
            }
            .onRefresh {
                try? await Task.sleep(nanoseconds: 2_000_000_000)
            }

Aviable API

Base function for working with refresh action:

            RefreshableScrollView {}
                .onRefresh {
                    try? await Task.sleep(nanoseconds: 2_000_000_000)
                }

To customize the Refresh Control stylet, use the protocol RefreshControlStyle:

            RefreshableScrollView {}
                .refreshControlStyle(CircularRefreshControlStyle())

Disable ScrollView:

            RefreshableScrollView {}
                .disableScroll($scrollIsDisabled)