I want to subclass GMSMarker. It is initialized with one property position: CLLocationCoordinate2D. It also has properties that can be set as follows:
let position = CLLocationCoordinate2DMake(51.5, -0.127)
let london = GMSMarker(position: position)
london.title = "London"
london.icon = UIImage(named: "house")
london.map = mapView
I want to add a new property rating
I tried like this
class Marker: GMSMarker {
var rating:Int
init(rating: Int){
self.rating = rating
super.init()
}
}
But this does not allow you to assign a value to a property ratingusing dot notation.
How can i do this?
source
share