title: Swift:Value of Type String can never be nil,Comparison isn't allowed
body: <p>This is my code</p>
  
  <pre><code>func enteredByStr(S:String) -&gt; String? {
      var healthactionplan : MyHealthActionPlanCondition
  
      if healthactionplan.addedBy != nil  {
          healthactionplan.addedBy = "System"
      } else {
          healthactionplan.addedBy = "Member"
      }
  }
  </code></pre>
  
  <p>I have even followed this <a href="https://stackoverflow.com/questions/33558933/why-is-the-return-value-of-string-addingpercentencoding-optional">This</a> and <a href="https://stackoverflow.com/questions/33708636/swift-string-cant-be-nil-so-why-can-stringbyaddingpercentencodingwithallowedc">This</a>. But still remains Unsolvable.Can anyone explain Why???</p>