title: Swift 3 - Declared variable giving me 'unresolved identifier error'
body: <p>Im trying to use the <code>securityCode</code> variable in an if statement but its saying that its an 'unresolved identifier', any idea why?</p>
  
  <p>heres my code:</p>
  
  <pre><code>func loginAction (sender: UIButton!){
      guard let url = URL(string: "myurl") else{ return }
  
      let session = URLSession.shared
      session.dataTask(with: url) { (data, response, error) in
          if let response = response {
              print(response)
          }
          if let data = data {
              print(data)
              do {
                  let json = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? NSDictionary
                  if let parseJSON = json {
                      let securityCode = parseJSON["security"] as? Bool
                      print("security code bool: \(String(describing: securityCode))")
                  }
  
              } catch {
                  print(error)
              }
  
          }
  
          }.resume()
  
      if securityCode! == true {
          let layout = UICollectionViewFlowLayout()
          let mainScreen = MainController(collectionViewLayout: layout)
          present(mainScreen, animated: true, completion: nil)
  
      }
  }
  </code></pre>