title: How to automatically create an initializer for a Swift class?
body: <p><strong>UPDATE:</strong>
  Use structs and not classes. Struct is better in many ways has got an initializer of its own.</p>
  
  <p>This is my model class. Is it possible to create the <code>init</code> method automatically? Everytime I have to initialize all the variables one by one and it costs a lot of time. </p>
  
  <pre><code>class Profile {
  
      var id: String
      var name: String
      var image: String
  
      init(id: String, name: String, image: String) {
          self.id = id
          self.name = name
          self.image = image
      }
  }
  </code></pre>
  
  <p>I want <code>self.id = id</code> and other variables to initialize automatically.</p>