问题
Xcode says that PHAsset doesn't have the 'location' member.
What's the remedy for Swift?
回答1:
Short answer: you might have forgotten to import CoreLocation;
import Photos
import CoreLocation
let asset: AnyObject? = nil
if let asset = asset as? PHAsset {
let location = asset.location
}
When I remove the CoreLocation import, I can replicate your error.
来源:https://stackoverflow.com/questions/30249163/how-to-i-extract-a-phassets-location-property