我使用的PlaceMarker创建该类PlaceMarker,不能转换值类型:
import UIKit
import GooglePlaces
import GoogleMaps
class PlaceMarker: GMSMarker {
let place: GMSPlace
init(place: GMSPlace) {
self.place = place
super.init()
position = place.coordinate
icon = UIImage(named: place.types+"_pin")
groundAnchor = CGPoint(x: 0.5, y: 1)
appearAnimation = GMSMarkerAnimation.pop
}
}
,但在该行
icon = UIImage(named: place.types+"_pin")
我采取_pin
错误Cannot convert value of type 'Never' to expected argument type 'String'
,怎么能我调整它?我试图改变_pin
与place.name
或String()
但问题是一样的
这个' “\(place.types)_pin”' –
尝试@SalmanGhumsani使这个答案。 – dasdom