diff --git a/Demo/List/Simple/SimpleCell.swift b/Demo/List/Simple/SimpleCell.swift index 423c019..e760321 100644 --- a/Demo/List/Simple/SimpleCell.swift +++ b/Demo/List/Simple/SimpleCell.swift @@ -32,7 +32,7 @@ struct SimpleCell: View { struct SimpleCell_Previews: PreviewProvider { static var previews: some View { - List { + ScrollView { ForEach(SimpleList.generateItems(count: 4)) { item in SimpleCell(item: item) } diff --git a/Demo/List/Simple/SimpleList.swift b/Demo/List/Simple/SimpleList.swift index ec5baee..d81325c 100644 --- a/Demo/List/Simple/SimpleList.swift +++ b/Demo/List/Simple/SimpleList.swift @@ -22,7 +22,7 @@ struct SimpleList: View { @State private var noMore: Bool = false var body: some View { - List { + ScrollView { if items.count > 0 { RefreshHeader(refreshing: $headerRefreshing, action: { self.reload() diff --git a/README.md b/README.md index 6f90ed8..c91ea68 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

- + codebeat badge @@ -34,7 +34,7 @@ Open `Refresh.xcodeproj` and run `Demo` target. ## Usage ```swift -List { +ScrollView { RefreshHeader(refreshing: $headerRefreshing, action: { self.reload() }) { progress in diff --git a/Sources/Refresh/List+Refresh.swift b/Sources/Refresh/List+Refresh.swift index 9491ddc..9a2da58 100644 --- a/Sources/Refresh/List+Refresh.swift +++ b/Sources/Refresh/List+Refresh.swift @@ -8,7 +8,7 @@ import SwiftUI @available(iOS 13.0, *) -extension List { +extension ScrollView { public func enableRefresh(_ enable: Bool = true) -> some View { modifier(Refresh.Modifier(enable: enable))