How to show UIProgressView with MKMapView? - iphone

In my application, i have latitude and longitude values to show a location in MKMapView. In previous version i have used UIActivityIndicator until Mapscreen loads in MKMapView. Now i want to show a UIProgressView instead of UIActivityIndicator.
Is it possible to show a progress with MKMapView? I searched lot and couldn't get proper or related solution so for.
Note:
What i have used with UIProgressView is uploading and downloading files with NSURLConnection. I want to know the process time of map loading section, then only i will able to show progress ? right.
Any one plz help me on this? Thanks in advance.

Unfortunately MKMapView doesn't natively support this.
You can check MKMapViewDelegate Protocol Reference and there are no such delegate methods. All you can get from it is only when map starts and finishes loading the data.

Related

What is the imagePickerController delegate method before the didfinishpickingmediawithinfo method is called?

So I have a visual cue (PNG rectangle lines) that pops up when taking a picture for this test app I’m doing.
So I remove the visual cue in the did finish picking media delegate method and/or the didcancel method as well. But I can’t find info on a delegate method for inbetween. Is there one? If there isn’t, is there a way to handle using a visual cue during image taking but not during the deciding “phase”?
I've looked at the Apple Docs but can't find anything so far. I'm trying to be better as far as attention to detail but I still struggle so my apologies if I didn't see it
I don't think there's code necessary to show so I can't show sample code.
No, the only delegate methods are imagePickerController(_:didFinishPickingMediaWithInfo:) and imagePickerControllerDidCancel(_:).
If you want to customize the user interface during picture taking, you can take a few approaches.
First, use the cameraOverlayView property to customize the UI.
Second, note that the UIImagePickerController is itself a UINavigationController. You can therefore set its delegate and respond to navigationController(_:willShow:animated:) to be notified when the user is about to move between view controllers. You could implement logic here to show, hide, or otherwise adjust your custom UI.

iOS ViewController After Load Method

I'm trying to find a method thats called once everything has been loaded and displayed. The reason I want to do this is because I have some images that take some time to load in so instead of showing them a black screen I want to show a loading page and then call a setup method.
However the only methods I can find are called before the views come into view...
I am probably being really dumb..
Any help would be great.
Disco
You can use
- (void)viewWillLoad;
and
- (void)viewDidAppear:(BOOL)animated;
to do what you need.
How about
- (void)viewDidAppear:(BOOL)animated;

How to tell when MKMapView and visible MKAnnotationView are finished drawing?

I'm displaying a MKMapView with MKAnnotations some of which are selected and showing their Annotation.
I am trying to grab an image of the displayed map and annotations using the -renderInContext.
90% of the time the Map, MKPinAnnotationView's and selected annotations are correctly captured.
The other 10% of the time the image is missing something, usually the MKPinAnnotationViews or their annotations if selected.
I've added code to deal with the Map itself loading it's map data.
But I haven't been able to track down something that would indicate to me that all of the visible MKPinAnnotationView's have been drawn
and if selected their annotations displayed??
the closest hint I've come across is the addObserver, although I haven't figured out what could be observed that would tell me when all of the drawing is done.
Thoughts?
ok I'm an idiot...
I finally tracked down the problem. In my viewForAnnotation routine in the MKMapView Delegate protocol I wasn't correctly setting values for reused MKPinAnnotationView's.
So some of the time I would reuse a view that had .canShowCallout set to YES and other times I'd reuse a view that had .canShowCallout set to NO.
.<
Try using the MKMapViewDelegate didAddAnnotationViews method.
If in that method, the drawing is still not ready for your requirements, you could then in there call your capturing method with performSelector:withObject:afterDelay:.

MKMapView and CLLocationManager

I want to use a MKMapView to display the user current location using the default breathing blue pin and I want to record the user movement at the same time. Is there any way that I could use the GPS manager (not sure if this is a CLLocationManager) the MKMapView uses when we enabled it to show user location?
I know that I can create my own CLLocationManager. But this feels like adding an overhead to my application and I would like the map and my tracking to remain in sync.
I already explored the following ideas without success:
Use the [MKMapView showUserLocation:YES] and add KVO on the userLocation field. This does not work and I am wondering if this is due to the fact that the userLocation field is read only.
Use the [MKMapView showUserLocation:YES], create a MKMapViewDelegate and add the tracking when the annotation view for the user location is requested. This does not work, because the annotation view is apparently requested only once???
Use a CLLocationManager and try to add the blue pin manually. Unfortunately, I did not find the blue pin in the available pin types, so I tried to create a user annotation manually without success.
Does anyone has any idea how I can achieve this and still benefit from the blue pin or is my only solution to use a CLLocationManager and create my own pin?
CLLocationManager uses the same data across all of its instances. MKMapView uses CLLocationManager's data internally. That said the solution to do what you want to do is let MKMapView do its own thing with regards to showUserLocation:. At the same time, create an instance of CLLocationManager and its delegate.
The delegate messages will give you the GPS coordinate location of MKMapView's blue pin. Everything will be in sync with each other.

Help getting dataSource working on OpenFlow

I need help getting dataSource in OpenFlow. I
I want to provide CoverFlow functionality whenever the phone is turned horizontally. I'm using Alex Fajkowski's awesome code OpenFlow ( http://fajkowski.com/blog/2009/08/02/openflow-a-coverflow-api-replacement-for-the-iphone/ ) but the example provided is very different than what I need.
I am using OpenFlow in a horizontal view inside a navbar view controller. I have OpenFlow working already. I can scroll through all my images and works really good. However I am using it with over 100 images and it takes a while to load at first. In looking into performance improvements I realized the AFOpenFlowViewDataSource delegate is not getting called. I was able to get AFOpenFlowViewDelegate working by specifying the delegate in the view controller class "flowView.dataSource = self;". But I am not able to get the datasource delegate working. Not even with "flowView.viewDelegate = self;".
Is the datasource needed at all? It seems it is needed for threading of loading.
Ok, it looks like it is running beautiful now. The DataSource delegate is only called when there the objects are loaded dynamically. Meaning, if I use "[(AFOpenFlowView *)self.view setImage]" then dataSOurce is never called because all it knows images are already loaded. However, using "[(AFOpenFlowView *)self.view setNumberOfImages:30];" triggers the DataSource delegate to load the images as they are needed. I found the GetImageOperation NSThread very useful for my 100+ images. However, images are not unloaded after going offscreen. Anyone know how to unload images as they go off screen?