Post

Replies

Boosts

Views

Activity

Failed to produce diagnostic for expression;
Hey I am getting this in my code, I'm a new coder and I need help fixing this, here is my code, please tell me my errors! Thank You! import SwiftUI enum Emoji: String{ case 😀,😝,🤨,🎉 } struct ContentView: View { @State var selection: Emoji = .🎉 var body: some View { VStack { Text(selection.rawValue) .font(.system(size: 150)) Picker("Select Emoji", selection: $selection) { ForEach(Emoji.allCases, id: \.self){ emoji in Text(emoji.rawValue) } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
1
0
483
Aug ’23
:thread return -x Error Encountered a crash
Im new to Xcode getting this error in this playground, can someone help me here... This was In a playground btw Thanks, struct Digit { var number : Int init(_ n: Int){ self.number = n } mutating func changeNumberTo(_ n:Int) { self.number = n } func otherFunction(_ f: ()->()) { } mutating func callAnotherFunction() { otherFunction { self.changeNumberTo(345) // * } } } var d = Digit(123) // Digit is a struct print(d.number) //123 var d2 = d //Assignment! d2.number = 42 print(d.number) enum Node { case none(Int) indirect case left(Int, Node) indirect case right(Int, Node) indirect case both(Int, Node, Node) }
2
0
527
Sep ’23