Shane
Shane

Reputation: 397

Text for callout button on pin annotation

Is it possible to have text instead of an image on the callout buttons from the map view?

Something like this?

let leftCalloutButton = UIButton(type: .Custom)
leftCalloutButton.text = "jobs"    // this line doesn't compile
pinView!.leftCalloutAccessoryView = leftCalloutButton

I've tried a few implementations of setTitle with no success. Any suggestions?

Upvotes: 0

Views: 226

Answers (1)

Marco M
Marco M

Reputation: 1235

UIButton have its own method to set title:

leftCalloutButton.setTitle("myTitle", forState: UIControlState.Normal)

Upvotes: 1

Related Questions