summaryrefslogtreecommitdiff
path: root/include/mbgl/ios/MGLCalloutViewProtocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/ios/MGLCalloutViewProtocol.h')
-rw-r--r--include/mbgl/ios/MGLCalloutViewProtocol.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/mbgl/ios/MGLCalloutViewProtocol.h b/include/mbgl/ios/MGLCalloutViewProtocol.h
new file mode 100644
index 0000000000..590a298d71
--- /dev/null
+++ b/include/mbgl/ios/MGLCalloutViewProtocol.h
@@ -0,0 +1,35 @@
+#import <Foundation/Foundation.h>
+
+#import "MGLTypes.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@protocol MGLCalloutViewDelegate;
+
+@protocol MGLCalloutViewProtocol <NSObject>
+
+@property (nonatomic, copy) NSString *title, *subtitle;
+@property (nonatomic, strong) UIView *leftAccessoryView, *rightAccessoryView;
+@property (nonatomic, weak) id<MGLCalloutViewDelegate> delegate;
+
+// Presents a callout view by adding it to "inView" and pointing at the given rect of inView's bounds.
+// Constrains the callout to the bounds of the given view.
+- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated;
+
+- (void)dismissCalloutAnimated:(BOOL)animated;
+
+@end
+
+
+@protocol MGLCalloutViewDelegate <NSObject>
+
+@optional
+// Controls whether the callout "highlights" when pressed. default YES. You must also respond to `-calloutViewClicked` below.
+- (BOOL)calloutViewShouldHighlight:(UIView<MGLCalloutViewProtocol> *)calloutView;
+
+// Called when the callout view is clicked.
+- (void)calloutViewClicked:(UIView<MGLCalloutViewProtocol> *)calloutView;
+
+@end
+
+NS_ASSUME_NONNULL_END \ No newline at end of file