Advertisement
luismachado

Untitled

Feb 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.66 KB | None | 0 0
  1. func shareLocation(with coordinates: CLLocationCoordinate2D, address: Address?) {
  2.  
  3.         let googleString = "https://maps.google.com/?q=\(coordinates.latitude),\(coordinates.longitude)"
  4.         var finalString = googleString
  5.  
  6.         if let address = address {
  7.             if address.completeAddress.isEmpty {
  8.                 finalString = "\(address.placeName)\n\(googleString)"
  9.             } else {
  10.                 finalString = "\(address.placeName)\n\(address.completeAddress)\n\(googleString)"
  11.             }
  12.         }
  13.  
  14.         DispatchQueue.main.async {
  15.             self.viewModel.sendTextMessage(text: finalString, isVideoCall: false)
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement