I hope i'm not out of order on my fisrt post here I'm a triple-oh nooob wanting to get fundamental concepts right
I get what classes are all about, but not so clear on difference between instances and inits ( initialisations )
Can i think of it this way?:
A small building development site has a design approved. (Blueprint) That'll be the class, sure enough
The 'instance' would be one unit bought in from the factory on a truck and craned in
but would the init be when the surveyor comes and pegs out its space 'allocation' on the site ? ( I started in Objective-C before Swift, and have only just looked into swift, you can tell ) or is it something else?
because Swift documentation tels me a 'var' or a 'let' object needs a value assigned, it cant be a nil. that's strange when I see lots of material with things like
var X : Int
let str : String
I see no values there, they say they explicitly want to see X = 5 or str ="cotton"
so tat leaves two possible analogies for init() :
var X : Int // like the building has the bounds set out, it's just not filling the space?
Var X = 5 // like the building is in place, but still empty and not in habitation
not asking for any great discussion, which is the 'more right'? if any