我正在创建这个课程
onStartUp()
用于PlaceMarker,但在行
WebApplicationInitializer
我接受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
,但问题是相同的
答案 0 :(得分:1)
尝试使用此 "\(place.types)_pin"