PlaceMarker,无法转换类型的值:

时间:2017-09-26 09:10:29

标签: ios swift xcode swift3

我正在创建这个课程

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") ,我该如何调整呢?我尝试使用_pinCannot convert value of type 'Never' to expected argument type 'String'更改_pin,但问题是相同的

1 个答案:

答案 0 :(得分:1)

尝试使用此 "\(place.types)_pin"