Issue with new MapKit MarkerAnnotationView in iOS 11

I’m having trouble with MKAnnotationView. I wrote the code embedded below to display my pin, which works, but I never EVER want the subtitle to show up, so I wrote the var subtitleVisibility: MKFeatureVisibility to .hidden, as shown in my code. Though it still shows up, just like if the subtitleVisibility was .adaptive …
What’s wrong? Thanks in advance for your help!
Flo!

func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
    if #available(iOS 11.0, *) {
        guard let annotation = annotation as? Bike else { return nil }

        let identifier = "marker"
        var view: MKMarkerAnnotationView

        if let dequeuedView = mapView.dequeueReusableAnnotationView(withIdentifier: identifier)
            as? MKMarkerAnnotationView {
            dequeuedView.annotation = annotation
            view = dequeuedView
        } else {
            view = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: identifier)
            view.canShowCallout = false
            view.markerTintColor = self.userBike.markerTintColor
            view.glyphImage = self.userBike.glyphImage
        }
        view.subtitleVisibility = MKFeatureVisibility.hidden
        view.animatesWhenAdded = true
        return view
    } else {
        let annotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: "pin-annotation")

        annotationView.animatesDrop = true
        annotationView.canShowCallout = true
        return nil
    }
}

  • Rotate UIImage in swift
  • How to crop audio in ios
  • How to convert JSON to a dictionary in swift iOS?
  • Xcode — finding dead methods in a project
  • How do I compile libffi for iOS & macOS?
  • PyObjC on Xcode 4