I\'m a Swift newbie and I\'m trying to get my head around using Structs with optional properties. I\'ve done quite a bit of searching and got something that works but it fee
Use default values:
init(busName: String, website: String? = nil, address: String? = nil) {
self.name = busName
self.web = website
self.address = address
}
Then you can call the init like this:
_ = Business(busName: "Foo")
_ = Business(busName: "Foo", website: "www.foo.bar")
_ = Business(busName: "Foo", address: "bar")
_ = Business(busName: "Foo", website: "www.foo.bar", address: "bar")