Code Block import SwiftUI struct ContentView: View { @State var clicked = 0 var numberValue = [1: "won", 9: "Nein!", 69: "nice.", 123: "321", 666: "ILLUMINATI", 6969: "very nice."] func addOne() { clicked += 1 print(clicked) } var body: some View { VStack{ Text("Clicker: The Game") .font(.largeTitle) .fontWeight(.bold) .multilineTextAlignment(.center) .offset(y: -225) Text(numberValue[self.clicked] ?? String(self.clicked)) .font(.system(size: 69)) .offset(y: -125) Button(action: addOne) { Text("Tap me!") .offset(y: -10) .font(.system(size: 30)) .background(RoundedRectangle(cornerRadius: CGFloat, style: RoundedCornerStyle = .circular)) } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Code Block .background(RoundedRectangle(cornerRadius: CGFloat, style: RoundedCornerStyle = .circular))
It should be something like this:
Code Block .background(RoundedRectangle(cornerRadius: 10, style: RoundedCornerStyle.circular))
Swift compiler should generate the right diagnostics pointing the line causing the issue. You should better send a bug report using the Feedback Assistant.
But, anyway, the current Swift compiler (you should better include the info of the Xcode version) is not good at generating proper diagnostics in ViewBuilder. You may need to comment-out/code-in each parts one by one and find which part of your code is causing this issue.