title: Check if TWO objects are nil in Swift, ios xcode
body: <p>I want to compare two objects(of the same Class) and return what is NOT nil.</p>
  
  <p>How do you write something like this in swift? :</p>
  
  <pre><code>func returnWhatIsNotNil(objA: SomeClass, objB: SomeClass) -&gt; SomeClass {
      if objA != nil &amp;&amp; objB != nil { //error
        //both are not nil
        return nil
      }
  
      if objA == nil &amp;&amp; objB != nil { // error 
         // objA is nil
         return objB
      }
  
      if objA != nil &amp;&amp; objB == nil { // error
         // objB is nil
         return objA
      }
   }
  </code></pre>
  
  <p>with one object, </p>
  
  <pre><code>if let x = objA {
      //objA is not nil
  }
  </code></pre>
  
  <p>would do the job, but I quiet don't know how I would do this with TWO objects.</p>