So while learning Swift, I came across two ways to initialize parameters in a struct,
struct Fruit {
let name: String
}
let _ = Fruit(name: "Apple")
or,
struct Fruit {
let name: String
init(name: String) {
self.name = name
}
}
let _ = Fruit(name: "Apple")
What is the difference between two or maybe which one is correct?