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.
Related
I am adding annotations to a pdf document and this works as expected. Now I also want to delete them and here I am facing some issues.
As I see, it should work out of the box, but when I long click on an annotation mostly of the time the text around of it is being selected but not the annotation itself.
This is one example where I created a big annotation so that I am sure that my finger is not touching any text around of it. When I long click on it this is what I get most of the time (this is not always, sometimes the menu also appears over the annotation and I am able to delete it via the delete action):
I also tried to add a long-press/tap gesture on the PDFKit and in these situations when I long click on the annotation and the text is being selected, my long press gesture is not being fired. I assume that the view hierarchy inside PDFKit is causing this issue.
With the tap gesture I am able to detect the annotation when it's being tapped, but in this case the controller?? that is displaying the annotation text is not being shown (I guess because I intercept the tap gesture). Is there a way to still trigger the annotation display and modify the controller (add additional navigation button since now there is just a "Done" button)? This is the particular controller when I tap the orange note icon:
Adding hightlight annotations to text and removing them works as expected (because there is no problem with selecting text)
Is there a way to somehow force the PDFKit to mark the annotation as selected when I long click on it? Modifying the controller that is being displayed when an annotation is being tapped would also help.
In case somebody else is struggling with this.
I chose to display the annotation inside a custom controller.
First I implemented a TapGestureRecognizer on the pdfview, from there got the annotation and then displayed the annotation inside the custom controller.
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.
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.
I want to do somethings on UIImagePickerController, I detected the view (named A) contains all the images in library. When I choose an image, I want to draw somethings on it.
I can get the image into my controller using delegate didFinishPickMediaWithInfo of UiImagePickerControllerDelegate , but I can't detect which point I tap on view A (to draw some view at this point). I tried to add TapGestureRecognizer to view A, it's really return for me the point but unfortunately it can't run into the delegate didFinishPickMediaWithInfo, so I can't get the chosen Image.
I don't have any idea to achieve 2 things at the same time, get the chosen image on delegate didFinishPickMediaWithInfo and return the point I've tapped.
Are there any idea (maybe just idea) to guide me to achieve this
Thanks
Thank all,
Finally, I find out a solution for me to resolve this problem. It's simple and quite like cheating. I add tap gesture on UIWindow and everything go through.
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.