Skip to content

Instantly share code, notes, and snippets.

@pitt500
Last active May 29, 2020 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pitt500/2fc0357f072f96bd301bbf1f18cbe4a6 to your computer and use it in GitHub Desktop.
Save pitt500/2fc0357f072f96bd301bbf1f18cbe4a6 to your computer and use it in GitHub Desktop.
public var body: some View {
List {
//1.
ForEach(items.indices, id: \.self) { index in
VStack {
//2.
self.content(self.items[index])
//3.
if self.isLoading && self.isLastItem(index: index) {
HStack(alignment: .center) {
//4.
SpinnerView(isAnimating: self.$isLoading, style: .medium)
}
}
}.onAppear {
//5.
self.itemAppears(at: index)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment