title: How to check variable value in swift 3?
body: <p>I would like to check the value of the outgoing variable whether it is 0 or 1. I tried below code to do the same but I am not able to check it. In below code <code>message</code> is a dictionary which contains values of <code>XMPPMessageArchiving_Message_CoreDataObject</code>.</p>
  
  <p>How to check the value of <code>outgoing</code> variable?</p>
  
  <p><code>message</code> dictionary contains:</p>
  
  <pre><code>bareJid = "(...not nil..)";
  bareJidStr = "tester3@90.0.0.163";
  body = "{\"Date\":\"14 Jun 2017\",\"Time\":\"4:21PM\",\"body\":\"hello\",\"filePath\":\"\",\"isImportant\":\"N\",\"isMine\":true,\"msgid\":\"167-36\",\"receiver\":\"tester1\",\"sender\":\"tester3\",\"senderName\":\"tester3\"}";
  composing = 0;
  message = "(...not nil..)";
  messageStr = "&lt;message xmlns=\"jabber:client\" to=\"tester1@90.0.0.163\" id=\"167-36\" type=\"chat\" from=\"tester3@90.0.0.163/Smack\"&gt;&lt;body&gt;{\"Date\":\"14 Jun 2017\",\"Time\":\"4:21PM\",\"body\":\"hello\",\"filePath\":\"\",\"isImportant\":\"N";
  outgoing = 0;
  streamBareJidStr = "tester1@90.0.0.163";
  thread = "2066797c-4f79-48f3-bd04-30658ee35e9f";
  timestamp = "2017-06-14 11:20:41 +0000";
  </code></pre>
  
  <p>When I debug the value of <code>outgoing</code> variable then Xcode shows the type of it is <code>Any?</code> and value of it is <code>some</code>.</p>
  
  <pre><code>let outgoing = messasge.value(forKey: "outgoing")
  var isIncoming = true
  
  if let og = outgoing as? Int {
      if og == 1 {
          isIncoming = false
      }
  }
  </code></pre>