Customizing annotations pop up in iPhone? - ios

I'm building an app for iPhone in which I need to customize the poped up annotation whenever the user clicks on the pin. But the point is I don't wanna use the default annotation view and I have created my own UIView (customized UIView) and whenever the user clicks on a pin, that customized view would be loaded on top of the screen.
Can someone tell me how to do it?

There a couple of solutions to this. Check out:
https://github.com/nfarina/calloutview for a nice project creating custom calloutViews.
Here has a nice writeup as well here.

Related

Custom MGLAnnotationView

How can I open new View, by tapping on Annotation Point in MapBox. I need to show the personal page of this or that place on the map. Can someone help me with that?
This example from the Mapbox website shows how to give the callout some functionality. The example just shows an alert when you tap it but you would just trigger your segue instead.

Go to next controller without using CallOutForAccessory MKMapview

I have a map view in that I am showing annotations. On clicking any annotation the callout (bubble with info) will appear above the annotation.
What I want is to navigate to another class by clicking the callout without using CallOutForAccessory delegate method. I have added touch gesture in didselect but it still didn't work. I have looked through the Internet but didn't find any solution for the same. Most of the solutions compromise of CallOutForAccessory. Please share your ideas if anyone has done this before.

Custom Callout View like MKAnnotationView's Callout

I have a custom MKAnnotationView which I have customised according to the documentation of Apple Docs.
So far it's been really nice to follow it because it was very neat and clean code and I haven't used any third party for it. Here's the screenshot of it.
Now I am stuck at the UI part of it, making callout look like native callout. I don't want to use any other third party in which I would have to redo my work or I have to abandoned guidelines of Apple.
So I guess I am looking for a simple solution which I can make in my Callout View's xib or similar.
Thanks,
Attiqe
Ok so I have finally figured out a way. I was loading the callout view from a nib and I have made changing in it to mimic the native look. I have embedded my icons/uiimageview's into another uiview. Parent view will be transparent and child view(that contains all the icons now) will have another uiimageview(with callout arrow) at it's centre bottom.
This solved my problem.
Thanks,
Attiqe

iOS map style config slide up?

iOS 7 has changed how maps are displayed by apps on the iPhone, and especially how the user configures the map.
The map is displayed like this, with an Info button.
When the user taps the Info button, the configuration screen slides up.
How do I recreate a screen overlay like this in my code? While I don't want the user to be dropping pins, I want the user to be able to switch between different map styles or open the address I'm pointing to in Apple's Maps app.
If you are trying to do a simple overlay view, then look into making an UIView slide up through UIView animations. Other than that, you would need an UISegmentedControl and related code. You would also need to blur the view and make it translucent, so look into my other question and answer on how to properly blur an UIView:How to apply blur to a UIView?
I've never looked into it, but I've heard the only easy way to do a translucent background (as in, without writing your own OpenGL code) is to create a UIToolbar instance.
I'm guessing you'd make a toolbar with no items, just treat it like UIView and add your own subviews (UITableView, etc). It is a subclass of UIView.

Adding Custom Image on Mkannotationview, or on callout bubble?

i'm trying to reproduce the kind of map behavior of the app "Stuck On Earth". Here's a screenshot :
Here's the behavior :
On the map, as you can see there is pin
When you click on a pin, it display the picture attach to it. Really important : the picture stai with the pin, and it stays BEHIND it
If you click on the picture, a new controller is called
if you click on the pin, the picture disappear
I'm trying to do something similar. For now, as i can read, i've got two solutions :
Using callout : callout is HELL. I can try to use a false annotation, but MapKit deals with the depth of elements, and the picture is always in front of the pin
Using Custom Annotation : i was going for the plan of making custom annotation view, when the pin is tapped, i launch a method of the CustomAnnotationView, adding (or removing) the thumbnail.
I think the method number 2 could work, but i've got no idea how to deal with the touch on the thumbnail.
Any suggestions or help on this ?
Thanks you !
Updated 2016-09-02:
My colleague devised an workaround by making popup views as subview of the view container which contains the map view. The position can be calculated according to the CGPoint transform in different reference systems.
Original Answer:
I also got this kind of problem, after following the tutorial 'Building Custom Map Annotation Callouts – Part 1', the interaction becomes difficult.
Have you tried the tap gesture recognizer? I added it to a subview, it works, although the code smell bad.

Resources