MKAnnotationView - Callout title or description with multiple lines? - ios

Is it possible to display several lines in title or description/subtitle without writing your own custom annotation view, using i.e. MKPinAnnotationView?

I believe it's not possible.
What you need is to create a custom callout, and layout it the way you want. You can even mimic the native appearance.
This page can help you creating the custom callout: http://blog.asolutions.com/2010/09/building-custom-map-annotation-callouts-part-1/

Related

How does Apple add rating stars to callouts on map views?

Trying to do something that shouldn't be this difficult. Trying to display stars for a rating very similar to a screenshot (below) that Apple provides in the Maps Programming Guide for iOS.
Basically in the subtitle of the Annotation callout, I want to show some stars in a different color than the rest of the text in the subtitle.
I really cannot figure out how to do this without going through the entire nonsense of creating an entirely custom callout. They provide some documentation on doing that, but I am trying to avoid it unless I really have to.
As far as I can tell, with the out of the box MKAnnotation protocol, both title and subtitle properties are just NSString...if I could use an attributed string I could make it work, but it doesn't seem possible. Is Apple "cheating" here by creating a custom callout that looks just like the "normal" one?
Will I really need to go through the process of creating an entire custom callout just to do this? I really want to keep all the existing functionality and layout of the native callout.
Thanks!
Nevering having used this library, I defer to the documentation which mentions:
To provide custom callout views, override the leftCalloutAccessoryView method and use it to return the views.
Although it's under the Subclassing heading for the class documentation, I don't think that means to subclass the entire MKAnnotationView.
The class has a leftCalloutAccessoryView property which is not listed as readonly and has a default value of nil, so presumably you'll need to at least create a custom view, and then set the MKAnnotationView.leftCalloutAccessory to it.
The MKAnnotation protocol seems to just provide limited information to be used by the MKAnnotationView

Multiple lines in RMAnnotation title in Mapbox?

Im wondering if its possible to make the annotation title that comes up when you tap an annotation have multiple lines. Mapbox uses the SMCalloutView for that popup view.
The Mapbox references are very poor for ios...
You can fork SMCallOutView an create your own custom version after you can Use it like this question.
How to change margins in SMCalloutView

Show a callout in a iOS UIView

Is there a way to get custom callouts on a regular UIView in iOS?
What I am looking for is a solution similar to Quickactions in Android.
Has anyone tried to do this kind of implementation and been successful at it?
Short answer is NO, there is no built-in way to get something like this. However, you can build your own custom callout UIView and add it as a subview to the parent view.

Is it possible to 'hyperlink' text within a UILabel/TextView but activate a segue on tap of this 'hyperlink'?

I say 'hyperlink' because I don't know what else to call it, and that is how i'd like it to appear.
Obviously this is possible using a combination of labels and buttons, but my labels and buttons are programmatically generated and I imagine i'd have to also programmatically arrange them, which would likely be tedious and inflexible in terms of changing font sizes etc.
Any ideas/approaches would be much appreciated!
As an example, look at Instagram's following and news feed:
You should set userInteractionEnabled and then add a UITapGestureRecognizer to the label.
Have a look at Nimbus Attributed Label it can provide the functionality you are looking for.

How to create custom annotation and callout bubble in iphone?

I want to create a customized annotation and callout bubble on MKMapView. I need to use a customized view rather than default annotation pin and annotaion view(which is limited to show only title and a single line description). When user tap on an annotation, I would like to display more information on the callout bubble.
I passed by this control but I haven't used it:
http://cocoacontrols.com/platforms/ios/controls/custom-callout
I've found some pretty good controls at that site.

Resources