/LSRefreshable

Adapt SwiftUI's Refreshable to iOS13 and iOS14

Primary LanguageSwift

LSRefreshable

Adapt SwiftUI's Refreshable to iOS13 and iOS14

Requirements

  • Xcode 12.x
  • Swift 5.x

Installation

  1. File -> Swift Packages -> Add Package Dependency...
  2. Enter package URL :https://github.com/sandsn123/LSRefreshable.git, choose the latest release

Expamle:

  ScrollView {
      ForEach(0..<array.count, id: \.self) { index in
          let text = array[index]
          HStack {
             Text(text)
          }
      }
 }
 .makeRefreshable {
      try? await Task.sleep(nanoseconds: 2_000_000_000)
 }