Skip to content

Commit 231ddc1

Browse files
Update README.md
1 parent 7ab5830 commit 231ddc1

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

README.md

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,10 @@ struct TestView: View {
1515
@State private var pageState: PageStates = .loading
1616

1717
var body: some View {
18-
NavigationView {
19-
ScrollView {
20-
ForEach(0..<100, id: \.self) { _ in
21-
AsyncImage(url: URL(string: "https://picsum.photos/1000")) { phase in
22-
if let image = phase.image {
23-
image
24-
.resizable()
25-
.scaledToFill()
26-
} else {
27-
Color.gray
28-
}
29-
}.frame(height: 200, alignment: .center)
30-
.clipped()
31-
}
32-
}.navigationTitle("Example Content")
33-
}
34-
.modifier(ErrorableViewModifier(pageState: $pageState) { // Like this
35-
DefaultErrorView(type: .sheet) {
36-
pageState = .loading
37-
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
38-
pageState = .successful
39-
}
40-
}
41-
})
42-
.onAppear {
43-
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
44-
pageState = .failure
45-
}
46-
}
18+
// YOUR CODES
19+
.akErrorView(pageState: $pageState) {
20+
// TRY AGAIN ACTION
21+
}
4722
}
4823
}
4924
```

0 commit comments

Comments
 (0)