Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bart Louwers <bart@emeel.net>
40 lines
754 B
Objective-C
40 lines
754 B
Objective-C
#import "MLNCompactCalloutView.h"
|
|
|
|
#import "MLNAnnotation.h"
|
|
|
|
@implementation MLNCompactCalloutView
|
|
{
|
|
id <MLNAnnotation> _representedObject;
|
|
}
|
|
|
|
@synthesize representedObject = _representedObject;
|
|
|
|
+ (instancetype)platformCalloutView
|
|
{
|
|
return [[self alloc] init];
|
|
}
|
|
|
|
- (BOOL)isAnchoredToAnnotation {
|
|
return YES;
|
|
}
|
|
|
|
- (BOOL)dismissesAutomatically {
|
|
return NO;
|
|
}
|
|
|
|
- (void)setRepresentedObject:(id <MLNAnnotation>)representedObject
|
|
{
|
|
_representedObject = representedObject;
|
|
|
|
if ([representedObject respondsToSelector:@selector(title)])
|
|
{
|
|
self.title = representedObject.title;
|
|
}
|
|
if ([representedObject respondsToSelector:@selector(subtitle)])
|
|
{
|
|
self.subtitle = representedObject.subtitle;
|
|
}
|
|
}
|
|
|
|
@end
|