Created
October 14, 2019 12:44
-
-
Save marcelosalloum/023a78dc39a2cef12980aaa1536ab08d to your computer and use it in GitHub Desktop.
HUD usage on medium post - v1
This file contains hidden or 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
| 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