I have this button, that should show/hide certain annotation pins on my map. I have this function down below, but when you press it to remove the pins, it removes all pins. It should only remove the pins that are inside the addAttractionPinsBilka? What can I do to make this happen?
Here is my code:
@IBAction func bilkaAction(sender: AnyObject) {
if !annotationBilkaIsVisible {
addAttractionPinsBilka()
annotationBilkaIsVisible = true
}else {
map.removeAnnotations(map.annotations)
annotationBilkaIsVisible = false
}
}
Hope you can help me :-)