Annotation turn to it's default state in iOS 9 - iphone

In iOS 9 map annotation is showing up as black pin for current location and other as red pin. My custom assets are missing and also on tap my custom callout view is not showing up. I am not sure what happening. Same code is running in iOS 8 and everything work as expected. Any idea?

You have to subclass your annotation view from MKAnnotationView, not from MKPinAnnotationView. I had the same issue and I solved my problem with this.

Related

Adding ViewController's View as subview to UIPageViewController in iOS 8 gives weird UINavigationBar while show/hide

I have been working on a project where I needed to show list of images with zoom / swipe feature as presented view modal. I created custom ImageViewer using ContainerView in which I have added UIPageViewController. And on demand, I added ImageViews over the UIPageViewcontroller's view. When user taps to imageView, the top UINavigation gets shown and hidden on toggle basis.
Everything worked as expected in iOS 7.1 and less. However when I tested the functionality in iOS 8 devices and simulator, the ImageViews were not added to UIPageViewController in TopLeft ( beneath UINavigationBar ). It is added below the NavigationBar as shown in bug_iOS_8.png below.
Once I touch the buggy view, it repositions itself to correct position as in image expected.png below.
I have created and tested the issue in sample project and it seems it is bug in iOS 8 itself with UIPageViewController. I went through couple of questions regarding weird behavior of UIPageViewController too. Please check the sample app here and kindly let me know if anyone has any hints on what is going on.
Thank you for your time and help.
PS: BTW I am using following version of Xcode.
Update 1:
I have tried as per the pin suggestions. However, the problem aligning is with the main view of UIViewController rather than its subview. In below image, Yellow is main View of UIViewController and red one is added subview, I added pin to "red" on in reference to superview "yellow" one. Please check following screen shots.
On startup.
After touch on screen.
Kind Regards,
check in storyboard for particular viewController and make sure Extended Edges >> Under top bars is not selected.
I had a very similar issue and the way i fixed it was select the view being added to the UIPageViewController in the storyboard and selected the pin options. Below in the image you can see the Constrain to margins options, make sure you unselect that. Also when choosing what view to pin it to make sure you select the superview and not the Top Layout Guide.
Curious are you hiding your nav controller like this?
[self.navigationController setNavigationBarHidden:YES];
also if you have multiple Nav controllers, you might need to check you are referencing the correct one.
If you want it to be hidden when you present the ViewController you should move it to
-(void) ViewWillAppear{
}

UISearchDisplayController overlay positioning

I'm having a bit of difficulty with UISearchDisplayController and the positioning of it's grey overlay when building against iOS 7. This was working fine when building against iOS 6, but only seems to have
I have a UIView built into a base ViewController which needs to be shown on every page (reads "Hello thereAnother String") in the screenshot before. When I navigate to my view controller which includes the UISearchDisplayController, this is what I see:
This is fine and is what I'd expect to see. However, when I try to click on the view UISearchBar, this is what I see:
Note that the grey overlay is offset by the size of that UIView that I need to put in all screens of the application.
Any ideas on why this might be happening?
can you use custom category of UITextfield and override those Method the
- (CGRect)textRectForBounds:(CGRect)bounds; and
- (CGRect)editingRectForBounds:(CGRect)bounds ;
this problem occur from custome this method.

callout pops up behind the pins in MKMapView - iPhone

I have 10 custom annotations on my map but sometimes the callout pops out behind the pins.. any idea to resolve this?
I have checked out this link
Z-ordering of MKAnnotationViews
but since my callouts are not popping up by tap but they are popping up by click on button so this answer is worthless to me.
Any kind of help will be really appreciated.
The reason behind this is because some where in your code you are calling bringSubviewToFront on the annotationView.

Dragging MKAnnotationView immediately

When you set the draggable property of an MKAnnotationView, the default behavior seems to be:
1) user taps the annotation
2) user drags the annotation
Is is possible to combine this into one, so the user can drag the annotation without tapping it first?
try this source code http://www.github.com/digdog/MapKitDragAndDrop I have tried this code in simulator and it is working fine

MKAnnotationView in both hovering and pinned states

I'm trying to add a pin (MKAnnotation and MKAnnotationView) to my MKMapView and allow the user to drag it around.
I'd also like to make the dragging of the pin animated and interactive like the iPhone's Map App.
My question is how do I change the state of the MKAnnoationView so that it's hovering over the map (so the pin isn't actually inside the map)?
I'm not 100% sure how to do this.
At present, my colleague as found an hovering image that he swaps with the default MKAnnotationView, but that means I can't easily animate between the two.
Not sure what you exactly want to do but I have used Apple's example in the iPhone App Programming Guide (Handling Events in an Annotation View) to implement the draggable pin.
It has a partial code but tha may be enough for you to figure it out.
Basically, you must subclass the MKAnnnotation and MKPinAnnotationView and in your CustomAnnotationView class you have to implement delegate methods to handle touch events, as shown in the Apple example.
There was a bit of filling out or modification needed because the code snippet was not complete, but I have reproduced the behaviour of the pin on the Apple's iPhone Map app exactly (except that I did not implement the right accessory button).
In it, the pin feels like it is hovering. So, I suspect that you have no need for the hovering image you have mentioned.
I also presume that by providing a BOOL property, you could make the pin draggable or "fixed" programmatically.
Does this help?