title: I cannot fix EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) in Swift xcode 8.1 on Json
body: <p>I am studying the swift and I update the xcode to current version (8.1). So the source that I saved was changed. When I ran the code. It cracked and I cannot fixed it. It showed "EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)" on the last line. This is a code that I have studied from web.
  Thank you very much.</p>
  
  <pre><code>let urlString = "http://swapi.co/api/people/1/"
  let session = URLSession.shared
  let url = URL(string: urlString)!
  
  session.dataTask(with: url, completionHandler: { (data: Data?, response:URLResponse?, error: NSError?) -&gt; Void in
  
  if let responseData = data {
  
      do {
          let json = try JSONSerialization.jsonObject(with: responseData, options: JSONSerialization.ReadingOptions.allowFragments)
  
          if let dict = json as? Dictionary&lt;String, AnyObject&gt; {
  
              if let name = dict["name"] as? String, let height = dict["height"] as? String, let birth = dict["birth_year"] as? String, let hair = dict["hair_color"] as? String {
  
                  let person = SWPerson(name: name, height: height, birthYear: birth, hairColor: hair)
  
                  print(person.name)
                  print(person.height)
                  print(person.hairColor)
                  print(person.birthYear)
  
                  if let films = dict["films"] as? [String] {
                      for film in films {
                          print(film)
                      }
                  }
  
              }
          }
  
  
      } catch {
          print("Could not serialize")
      }
    }
  } as! (Data?, URLResponse?, Error?) -&gt; Void) .resume()
  </code></pre>