[SwiftUI] Slider text is not appearing at all

The sliders themselves are rendered, but not the text no matter what I try.

Here is my code for reference:

var body: some View {
        ScrollView {
            Text("Synth View")
                .font(.system(size: 55, weight: .semibold, design: .rounded))
                .padding(.bottom)
            VStack {
                Button(
                    "Trumpet",
                    action: {
                        modulatingMultiplier = 10
                        frequency = 200
                        carrierMod = 5
                        index = 440
                        amplitude = 10
                    }
                )
                
                LineGraph(data: data, maxData: maxData, minValue: graphMinValue, maxValue: graphMaxValue)
                    .clipped()
                    .background(Color.accentColor.opacity(0.1))
                    .cornerRadius(20)
                    .padding()
                    .aspectRatio(1, contentMode: .fit)
                
                
                VStack {
                    Slider(value: $frequency, in: 0...20000) {
                        Text("Frequency").padding(.horizontal)
                    }
                    Slider(value: $modulatingMultiplier, in: 0...1000) {
                        Text("Modulating Multiplier").padding(.horizontal)
                    }
                    Slider(value: $carrierMod, in: 0...1000) {
                        Text("Carrier Mod").padding(.horizontal)
                    }
                    Slider(value: $amplitude, in: 0...1000) {
                        Text("Amplitude").padding(.horizontal)
                    }
                    Slider(value: $index, in: 0...1000) {
                        Text("Modulation Index").padding(.horizontal)
                    }
                }.padding(.horizontal).frame(width: 600)
            }
            .onAppear {
                detector.onUpdate = {
                    data.append(Double(detector.pitch) * 0.01)
                    detector.setFrequency(Frequency : frequency, modulatingMultiplier : modulatingMultiplier, Amplitude: amplitude, cMult : carrierMod, index : index)
                }
            }
        }
    }

Accepted Reply

If you target macOS, the associated Text() fields appear. On iPadOS, they do not. I guess you have to describe the labels separately if that's the look you want. It would be nice if this behavior were documented somewhere.

Replies

If you target macOS, the associated Text() fields appear. On iPadOS, they do not. I guess you have to describe the labels separately if that's the look you want. It would be nice if this behavior were documented somewhere.