Last active
August 29, 2015 14:00
-
-
Save Duraiamuthan/11147595 to your computer and use it in GitHub Desktop.
iOS Map Annotation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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