2019-11-02a few seconds read (About 56 words)How to show loading indicator in SwiftUIIssue #486 1234567891011121314151617181920import SwiftUIstruct ActivityIndicator: UIViewRepresentable { @Binding var isAnimating: Bool let style: UIActivityIndicatorView.Style func makeUIView(context: UIViewRepresentableContext<ActivityIndicator>) -> UIActivityIndicatorView { return UIActivityIndicatorView(style: style) } func updateUIView(_ uiView: UIActivityIndicatorView, context: UIViewRepresentableContext<ActivityIndicator>) { isAnimating ? uiView.startAnimating() : uiView.stopAnimating() }}struct ActivityIndicator_Previews: PreviewProvider { static var previews: some View { ActivityIndicator(isAnimating: .constant(true), style: .large) }}#swiftUI