Skip to content

Instantly share code, notes, and snippets.

@marcelosalloum
Created October 14, 2019 12:44
Show Gist options
  • Select an option

  • Save marcelosalloum/023a78dc39a2cef12980aaa1536ab08d to your computer and use it in GitHub Desktop.

Select an option

Save marcelosalloum/023a78dc39a2cef12980aaa1536ab08d to your computer and use it in GitHub Desktop.
HUD usage on medium post - v1
import SVProgressHUD
import SwiftUI
struct ContentView: View, HUD {
var body: some View {
ZStack {
Color.black.edgesIgnoringSafeArea(.all)
VStack(spacing: 100) {
Button(action: {
SVProgressHUD.setBackgroundColor(.white)
SVProgressHUD.setForegroundColor(.black)
SVProgressHUD.showSuccess(withStatus: "BTN 1 Clicked")
SVProgressHUD.dismiss(withDelay: 2)
}, label: {
Text("Button 1")
})
Button(action: {
SVProgressHUD.setBackgroundColor(.white)
SVProgressHUD.setForegroundColor(.black)
SVProgressHUD.showSuccess(withStatus: "BTN 2 Clicked")
SVProgressHUD.dismiss(withDelay: 2)
}, label: {
Text("Button 2")
})
Button(action: {
SVProgressHUD.setBackgroundColor(.white)
SVProgressHUD.setForegroundColor(.black)
SVProgressHUD.showSuccess(withStatus: "BTN 3 Clicked")
SVProgressHUD.dismiss(withDelay: 2)
}, label: {
Text("Button 3")
})
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment