title: How to transform geographic coordinates into accurate address?
body: <p>I wanna reverse user's location, which contains values of latitude and longitude, into accurate address. But it doesn't work, it returned an empty string after execution.</p>
  
  <p>Also, Xcode suggested me using CNPostalAddress, I have no idea what it is.</p>
  
  <p>Here's the function</p>
  
  <pre><code>import Foundation
  import CoreLocation
  import AddressBook`
  
      func reverseGeocoder()-&gt;String{
          let info:String?
          var geocoder = CLGeocoder()
          var currentUserLocation = CLLocation(latitude: 30, longitude: 122)
          geocoder.reverseGeocodeLocation(currentUserLocation, completionHandler: {
              (placemarks,error) -&gt; Void in
              if placemarks != nil &amp;&amp; placemarks?.count &gt; 0{
                  let placemark = placemarks![0] as CLPlacemark
                  let addressDictionary = placemark.addressDictionary! as NSDictionary
  
                  let str:NSMutableString = ""
                  if let address = addressDictionary.objectForKey(kABPersonAddressStreetKey) as? String{
                      str.appendString(address)
                  }
  
                  if let state = addressDictionary.objectForKey(kABPersonAddressStateKey) as? String{
                      str.appendString(state)
                  }
  
                  if let city = addressDictionary.objectForKey(kABPersonAddressCityKey) as? String{
                      str.appendString(city)
                  }
  
                  info = str as String
              }
          }
          )
          return info
  }
  </code></pre>
  
  <p>Here are warnings
  <a href="https://i.stack.imgur.com/EFuFy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EFuFy.png" alt="Warnnings"></a></p>
  
  <p>appreciate it if you can help me fix it :)</p>