Answers for "ActivityIndicator swiftui white"

0

activity indicator swiftui

struct 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()
    }
}

//Usage...
ActivityIndicator(isAnimating: .constant(true), style: .large)
Posted by: Guest on March-02-2020

Code answers related to "ActivityIndicator swiftui white"

Code answers related to "Swift"

Browse Popular Code Answers by Language