Skip to content

Instantly share code, notes, and snippets.

@Duraiamuthan
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Duraiamuthan/11147595 to your computer and use it in GitHub Desktop.
Save Duraiamuthan/11147595 to your computer and use it in GitHub Desktop.
iOS Map Annotation
//header
@interface MKAnnotation : NSObject<MKAnnotation>
@property (strong, nonatomic) NSString *title;
@property (strong, nonatomic) NSString *subtitle;
@property (nonatomic,assign) CLLocationCoordinate2D coordinate;
-(id) initWithCoordinate:(CLLocationCoordinate2D)Coordinate title:(NSString *)Title andsubTitle:(NSString*)Subtitle;
@end
//implementation
@implementation MKAnnotation
-(id) initWithCoordinate:(CLLocationCoordinate2D)Coordinate title:(NSString *)Title andsubTitle:(NSString*)Subtitle{
if ((self = [super init])) {
self.coordinate =Coordinate;
self.title = Title;
self.subtitle=Subtitle;
}
return self;
}
@end
//Usage
MKAnnotation *annotation=[[MKAnnotation alloc]initWithCoordinate:coord title:self.Name andsubTitle:customerSnippet];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment