Why am I getting this error? There's another post similar to this, but it doesn't have any answers.
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()
}
}
Post
Replies
Boosts
Views
Activity
I just want to share it with them. My app is nothing serious. It's just for fun.
I have a late 2012 iMac running Catalina. I find it really weird that Xcode 12 runs slowly because I can run Xcode 11 fine. It takes forever to build (around 2 minutes), simulate (around 5 minutes), and preview (around 3 minutes) on Xcode 12. Heck, I don’t even bother to toggle the live preview option. But, this wasn’t the case when I still used Xcode 11.
Will Apple be dropping support for older iMacs? How can I make it run faster?
Specs:
i5 3.2 Ghz Quad-Core
8 GB RAM 16MHz DDR3
1 TB storage
GTX 675MX 1 GB
My Mac isn’t compatible with Big Sur, and I just started learning Swift and SwiftUI. Is it possible to develop apps on the latest iPadOS beta on macOS Catalina?