Nithin
Nithin

Reputation: 153

How to animate MapView once it loads?

Could someone please help me with loading maps using animation? I am trying to load a MapView. I want it to zoom to my place once the view loads. I am trying this:

- (void)viewDidAppear {
[super viewDidAppear:TRUE];
MKCoordinateRegion region;
CLLocationCoordinate2D location=secondMap.userLocation.coordinate;
MKCoordinateSpan span;
location.latitude=40.443242;
location.longitude=-79.94305;
region.span=span;
region.center=location;
[secondMap setRegion:region animated:TRUE];}

This code does not seem to work. When I tried, viewDidLoad, the location was already there, which I think is expected.

Thanks.

Upvotes: 1

Views: 230

Answers (1)

YNK
YNK

Reputation: 869

your viewDidAppear function is missing parameter

-(void)viewDidAppear:(BOOL)animated;

Upvotes: 2

Related Questions