Skip to content

Commit

Permalink
feat: change to support ScrollView
Browse files Browse the repository at this point in the history
  • Loading branch information
wxxsw committed Oct 30, 2020
1 parent e3a1f1f commit 05a4667
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Demo/List/Simple/SimpleCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion Demo/List/Simple/SimpleList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p align="center">
<a href="https://developer.apple.com/swift"><img src="https://img.shields.io/badge/language-Swift%205-f48041.svg?style=flat"></a>
<a href="https://developer.apple.com/swiftui"><img src="https://img.shields.io/badge/framework-SwiftUI-blue.svg?style=flat"></a>
<a href="https://developer.apple.com/ios"><img src="https://img.shields.io/badge/platform-iOS%2013%2b-blue.svg?style=flat"></a>
<a href="https://developer.apple.com/ios"><img src="https://img.shields.io/badge/platform-iOS%2014%2b-blue.svg?style=flat"></a>
<a href="https://github.com/apple/swift-package-manager"><img src="https://img.shields.io/badge/SPM-compatible-4BC51D.svg?style=flat"></a>
<a href="https://codebeat.co/projects/github-com-wxxsw-refresh-master"><img alt="codebeat badge" src="https://codebeat.co/badges/a130bdd3-eb27-4bf1-820f-8839bbbb3715" /></a>
<a href="https://github.com/wxxsw/Refresh/blob/master/LICENSE"><img src="http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat"></a>
Expand Down Expand Up @@ -34,7 +34,7 @@ Open `Refresh.xcodeproj` and run `Demo` target.
## Usage

```swift
List {
ScrollView {
RefreshHeader(refreshing: $headerRefreshing, action: {
self.reload()
}) { progress in
Expand Down
2 changes: 1 addition & 1 deletion Sources/Refresh/List+Refresh.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 05a4667

Please sign in to comment.