Question: Stored property without initial value prevents synthesized initializers (Swift/Xcode). I have a struct of a crossword board as such (you can ignore the values) struct
Stored property without initial value prevents synthesized initializers (Swift/Xcode).
I have a struct of a crossword board as such (you can ignore the values)
struct Board1 { var rowLocation : [Int] = [0,1,6,8,16,31,50,53,60,67,93] var rowDirection : [Character] = ["r","d","d","d","r","r","d","d","r","d","r"] var rowContent : [String] = ["ivory","vigor","after","bronze","fire","oath","fate","magic","attack","mini","casting"] }
I wanted to create a variable called State and set it equal to this Struct called Board1 so in my main viewController I used:
var state : Board1
I get this error "Stored property without initial value prevents synthesized initializers" as well as "ViewController has no initializers". Any idea where I'm messing up here? It all happens when I place that one line var state : Board1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
