title: Why I can't change value in nested Models?
body: <p>I have 2 class , First class has a property which inheritance from second class</p>
  <pre><code>class FirstModel{
  var firstType : Secondmodel?
  }
  class Secondmodel{
     var secondType : Int?
  
  }
  </code></pre>
  <p>Now I want to set a value to  <code>secondType</code> so I code</p>
  <pre><code>    var Modelll = FirstModel()
      Modelll.firstType?.secondType = 100
  </code></pre>
  <p>When I try to read this property with <code>print(Modelll.firstType?.secondType)</code> it return <code>nil</code>
  So first question is why I couldn't read this</p>
  <p>But I try to do this</p>
  <pre><code>    var Modelll = FirstModel()
      var ModelSecond = Secondmodel()
      ModelSecond.secondType = 100
      Modelll.firstType = ModelSecond
      print(Modelll.firstType?.secondType)
  </code></pre>
  <p>It works perfectly , printed out <code>Optional(100)</code> I really dont understand whats going on behind the scene. Can anyone explain this?</p>