Last active
May 29, 2020 21:14
-
-
Save pitt500/2fc0357f072f96bd301bbf1f18cbe4a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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