title: How to check if segue completed Swift 3?
body: <p>I have a segue which passes location data from a table view. I need to add a map annotation after this segue has completed, but the map is my initial VC, so it crashes on load due to the lack of data as the segue has not occurred. </p>
  
  <p>I think I need to wrap the following code (in the viewDidLoad) in an if statement that checks if the segue has occurred, or check if there is any data available to use. </p>
  
  <pre><code>    let roomPin = MGLPointAnnotation()
      roomPin.coordinate = CLLocationCoordinate2D(latitude: room.latitude, longitude: room.longitude)
  
      mapView.addAnnotation(roomPin)
  </code></pre>
  
  <p>Not entirely sure how I should be checking if there is any data to use.</p>
  
  <p>edit:</p>
  
  <p>room is a custom class loaded with alamofire </p>
  
  <pre><code>class Room {
  
  var roomNumber : String!
  var roomName : String!
  var latitude : Double!
  var longitude : Double!
  
  init(json : JSON) {
      roomNumber = json["room_number"].stringValue
      roomName = json["room_name"].stringValue
      latitude = json["latitude"].double
      longitude = json ["longitude"].double
  }
  </code></pre>
  
  <p>}</p>
  
  <p>then is called in a tableview to display the name and number. When pressed it performs a segue passing the Room object to my mapVC</p>
  
  <pre><code>    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  
  
      if segue.identifier == "mapSegue" {
          if let destination = segue.destination as? ViewController {
              destination.room = sender as! Room
  
  
          }
      }
  }
  </code></pre>
  
  <p>and in my map view controller I have that above annotation code in the viewDidLoad, with room being declared as: </p>
  
  <pre><code>var room : Room!
  </code></pre>
  
  <p>Any help is appreciated!</p>