I want to get 2 or more different object types on a map easily. Swift 2.0, I wanted to use Protocols.
I created a protocol that these object need to conform too. I a
After dealing with the hassle of MapViewController's data source being
var pins = [AnyObject]()
I came to the realisation that I could easily avoid all the associated issues of type checking and use the preferred array of PinProtocols
var pins = [PinProtocol]()
The workaround was simply
func addToMap() {
let mappingPins = pins.map{ $0 as AnyObject }
mapView.addAnnotations(mappingPins as! [MKAnnotation])
mapView.showAnnotations(mappingPins as! [MKAnnotation], animated: true)
}