I am trying to change the map type using a segmented control button, I wish for it to change the type of the map with 3 options: Standard, Satellite and Hybrid. So far I have this code but nothing happens once a different map type is selected:
@IBAction func segmentedControlAction(sender: UISegmentedControl!) {
if sender.selectedSegmentIndex == 0{
mapView.mapType = MKMapType.Standard
}
else if sender.selectedSegmentIndex == 1{
mapView.mapType = MKMapType.Satellite
}
else if sender.selectedSegmentIndex == 3{
mapView.mapType = MKMapType.Hybrid
}
}
I am new to Swift and Xcode so any help is appreciated :)
Thanks