My big project started throwing errors: Type 'ToggleStyle' has no member 'switch'
Made new test project:
struct ContentView: View {
@State var isOn = false
var body: some View {
Text("Hello, world!")
.padding()
Toggle(isOn: $isOn) {
Text("IPv6")
}
.toggleStyle(.switch)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Throws the same error: Type 'ToggleStyle' has no member 'switch'
what's wrong with this code ?
after i upgraded Xcdoe 13 beta to Xcode 13 i lost ability to build for 12.0
Please check the Software Download page of Xcode 13
Applications
Xcode 13
Xcode 13 includes everything you need to create and submit apps to the App Store for all Apple platforms. It Includes the SDKs for iOS 15, iPadOS 15, watchOS 8, tvOS 15, and macOS Big Sur. To continue developing apps for macOS Monterey, use Xcode 13 beta 5.
i can't event download Xcode-beta 13
You can download Xcode 13 beta 5 from the link on the page above, or you can download older Xcodes from the More Download pages.
Or you can use SwitchToggleStyle()
explicitly:
Toggle(isOn: $isOn) {
Text("IPv6")
}
.toggleStyle(SwitchToggleStyle())