2017-05-29 61 views
0

我使用此代码从Google API获取当前位置信息(国家 - 城市...等) 我的问题是,如何以阿拉伯语或其他语言获得结果国名?其他语言的ReverGeoCodeLocation结果

请帮助

// 
// ViewController.swift 
// Geocoding 
// 
// Created by Moaaz Nash on 5/29/17. 
// Copyright © 2017 Moaaz Nash. All rights reserved. 
// 

     override func viewDidLoad() { 
      super.viewDidLoad() 
      // Do any additional setup after loading the view, typically from a nib. 



      let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0) 
      let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera) 
      view = mapView 

      mapView.delegate = self 
      mapView.isMyLocationEnabled = true 


      if let mylocation = mapView.myLocation { 
       print("User's location: \(mylocation)") 
      } else { 
       print("User's location is unknown") 
      } 

      var longitude :CLLocationDegrees = 46.736228 
      var latitude :CLLocationDegrees = 24.756455 

      var location = CLLocation(latitude: latitude, longitude: longitude) //changed!!! 
      print(location) 

      CLGeocoder().reverseGeocodeLocation(location, completionHandler: {(placemarks, error) -> Void in 
       print(location) 

       if error != nil { 
        print("Reverse geocoder failed with error" + (error?.localizedDescription)!) 
        return 
       } 

回答