title: define unknown value from JSON with Bool type
body: <p>I want to store status (true/false/unknown) of the sensor, I have created php API to return JSON value without any issues but I can't store empty value, <code>NULL</code> value (nil value in swift ) in Bool variable. In this case, whether I need to define var String to store <strong>ON/OFF/Unknown</strong> value or I can use Bool var to store <code>true/false/nil</code>?</p>
  
  <p>I define Struct with Codable</p>
  
  <pre><code>struct nodedata: Codable {
  var nodeName: String
  var nodeID: String
  var temperature: Float
  var humidity: Float
  var relayStatus: Bool
  var lightStatus: Bool
  var hallStatus: Bool
  var smokeStatus: Bool
  var pirStatus: Bool
  enum CodingKeys: String, CodingKey {
          case nodeName = "node_name"  //Custom keys
          case nodeID = "node_id"
          case temperature = "temp"
          case humidity = "hum"
          case relayStatus = "relay_status"
          case lightStatus = "light_status"
          case hallStatus = "hall_status"
          case smokeStatus = "smoke_status"
          case pirStatus = "pir_status"
      }
  }
  </code></pre>
  
  <p>below is the class to store value get from JSON</p>
  
  <pre><code>class DataManager {
      var nodes = [nodedata]()    // i write main code to store JSON only...
  guard let data = data else { return }   // data get from URLSession
                          print(data)
                          let decoder = JSONDecoder()
                          self.nodes = try decoder.decode([nodedata].self, from: data)
  </code></pre>
  
  <p>I add JSON return from server </p>
  
  <pre><code>[
    {
      "node_name": "SVIN03",
      "node_id": "y2cfwecrw3hqznuxmfvf",
      "temp": 2132,
      "hum": 111,
      "pir_status": false,
      "smoke_status": false,
      "light_status": false,
      "hall_status": false,
      "relay_status": false
    },
    {
      "node_name": "SVIN04",
      "node_id": "aj2w1aljw8nd65ax79dm",
      "temp": 0,
      "hum": 0,
      "pir_status": false,
      "smoke_status": false,
      "light_status": false,
      "hall_status": false,
      "relay_status": false
    },
    {
      "node_name": "SVIN05",
      "node_id": "mwmfl2og2l8888fjpj2d",
      "temp": 999,
      "hum": 0,
      "pir_status": true,
      "smoke_status": false,
      "light_status": false,
      "hall_status": false,
      "relay_status": false
    }
  ]
  </code></pre>