Skip to content

Instantly share code, notes, and snippets.

@takoikatakotako
Created October 23, 2024 12:47
Show Gist options
  • Select an option

  • Save takoikatakotako/9716cf69daa49540060572859e6df4d4 to your computer and use it in GitHub Desktop.

Select an option

Save takoikatakotako/9716cf69daa49540060572859e6df4d4 to your computer and use it in GitHub Desktop.
SwiftUIでインディケーターを表示する
import SwiftUI
struct ContentView: View {
@State var showingIndicator = true
var body: some View {
ZStack {
VStack {
Spacer()
Button {
showingIndicator.toggle()
} label: {
Text("Show or Hide Indicator")
.foregroundColor(Color.white)
.padding()
.background(Color.gray)
.clipped()
}
}
if showingIndicator {
ProgressView()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment