title: Swift Initialize Struct with optional stored properties
body: <p>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 feels incredibly inefficient so wondered if there's a better/more manageable way of achieving my goal.</p>
  
  <p>I'd like to use Structs to represent a business but I have no idea in advance which combination of properties any specific business is likely to have. This seems to mean that I have to create an init() for every possible combination of parameters.</p>
  
  <p>Here's a simplified example (I have many more properties):</p>
  
  <pre><code>import Foundation
  
  struct Business {
      let name : String
      var web : String?
      var address: String?
  
      // just the business name
      init(busName: String) {
          self.name = busName
      }
  
      // business name + website
      init(busName: String, website: String) {
          self.name = busName
          self.web = website
      }
  
      // business name + address
      init(busName: String, address: String) {
          self.name = busName
          self.address = address
      }
  
      // business name + website + address
      init(busName: String, website: String, address: String) {
          self.name = busName
          self.web = website
          self.address = address
      }
  }
  </code></pre>
  
  <p>I can then initialise the class like this:</p>
  
  <pre><code>Business(busName: "Dave's Cafe", website: "http://www.davescafe.com")
  
  Business(busName: "Sarah's Brewhouse", address: "41 Acacia Ave, Smalltown")
  </code></pre>
  
  <p>Is there no way to create some kind of init() where the parameters are optional? If you could point me in the direction of terms or concepts to search for that would be great.</p>