summaryrefslogtreecommitdiff
path: root/include/mbgl/ios/MGLMapboxEvents.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/ios/MGLMapboxEvents.h')
-rw-r--r--include/mbgl/ios/MGLMapboxEvents.h53
1 files changed, 35 insertions, 18 deletions
diff --git a/include/mbgl/ios/MGLMapboxEvents.h b/include/mbgl/ios/MGLMapboxEvents.h
index bb28ec26c5..541f21df43 100644
--- a/include/mbgl/ios/MGLMapboxEvents.h
+++ b/include/mbgl/ios/MGLMapboxEvents.h
@@ -1,26 +1,43 @@
-//
-// MapboxEvents.h
-// MapboxEvents
-//
-// Created by Brad Leege on 3/5/15.
-// Copyright (c) 2015 Mapbox. All rights reserved.
-//
-
#import <Foundation/Foundation.h>
+extern NSString *const MGLEventMapLoad;
+extern NSString *const MGLEventMapTap;
+extern NSString *const MGLEventMapSingleTap;
+extern NSString *const MGLEventMapDoubleTap;
+extern NSString *const MGLEventMapTwoFingerSingleTap;
+extern NSString *const MGLEventMapQuickZoom;
+extern NSString *const MGLEventMapPanStart;
+extern NSString *const MGLEventMapPanEnd;
+extern NSString *const MGLEventMapPinchStart;
+extern NSString *const MGLEventMapRotateStart;
+extern NSString *const MGLEventMapLocation;
+
@interface MGLMapboxEvents : NSObject
-@property (atomic) NSInteger flushAt;
-@property (atomic) NSInteger flushAfter;
-@property (atomic) NSString *api;
-@property (atomic) NSString *token;
-@property (atomic) NSString *appName;
-@property (atomic) NSString *appVersion;
+// You must call these methods from the main thread.
+//
++ (void) setToken:(NSString *)token;
++ (void) setAppName:(NSString *)appName;
++ (void) setAppVersion:(NSString *)appVersion;
-+ (id)sharedManager;
+// You can call this method from any thread. Significant work will
+// be dispatched to a low-priority background queue and all
+// resulting calls are guaranteed threadsafe.
+//
+// Events or attributes passed could be accessed on non-main threads,
+// so you must not reference UI elements from within any arguments.
+// Copy any values needed first or create dedicated methods in this
+// class for threadsafe access to UIKit classes.
+//
++ (void) pushEvent:(NSString *)event withAttributes:(NSDictionary *)attributeDictionary;
-- (void) pushEvent:(NSString *)event withAttributes:(NSDictionary *)attributeDictionary;
+// You can call these methods from any thread.
+//
++ (NSString *) checkEmailEnabled;
++ (BOOL) checkPushEnabled;
-- (void) flush;
+// You can call this method from any thread.
+//
++ (void) flush;
-@end \ No newline at end of file
+@end