Category: IOS Dev

How to make a progress bar using swiftUI?

@State private var progress: Double = 0.0 let timer = Timer.publish(every: 0.1, on: .main, in: .common).autoconnect() var body: some View { ProgressView(value: progress, total: 100, label: { Text("Downloading...") .padding(.bottom, 4)…

How to make a circular progress icon in SwiftUI?

ProgressView(label: { Text("Loading") .font(.caption) .foregroundColor(.secondary) } ).progressViewStyle(.circular) this is old version, you should update code like this : // // ContentView.swift // ProgressIconandBar // // Created by WilliamJiamin on 2024/6/29.…

How to make a picker in SwiftUI?

```swift @State private var selectedFlavor: Flavor = .chocolate var body: some View {Form {Picker("Flavor",selection: $selectedFlavor) {ForEach(Flavor.allCases) {Text($0.description).tag($0)}}).pickerStyle(.automatic)}} ```

How to make a Slider using SwiftUI?

How to make a Slider using SwiftUI? @State private var volume: Double = 50.0 var body: some View { Slider(value: $volume, in: 0...100, minimumValueLabel: Image(systemName: "speaker"), maximumValueLabel: Image(systemName: "speaker.wave.3"), label:…