-
Notifications
You must be signed in to change notification settings - Fork 244
/
CountlyViewTracking.m
100 lines (82 loc) · 3.01 KB
/
CountlyViewTracking.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// CountlyViewTracking.m
//
// This code is provided under the MIT License.
//
// Please visit www.count.ly for more information.
#import "CountlyCommon.h"
@implementation CountlyViewTracking
+ (instancetype)sharedInstance
{
if (!CountlyCommon.sharedInstance.hasStarted)
return nil;
static CountlyViewTracking* s_sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{s_sharedInstance = self.new;});
return s_sharedInstance;
}
- (instancetype)init
{
self = [super init];
return self;
}
- (void)setGlobalViewSegmentation:(NSDictionary *)segmentation
{
[CountlyViewTrackingInternal.sharedInstance setGlobalViewSegmentation:segmentation];
}
- (void)updateGlobalViewSegmentation:(NSDictionary *)segmentation
{
[CountlyViewTrackingInternal.sharedInstance updateGlobalViewSegmentation:segmentation];
}
- (NSString *)startAutoStoppedView:(NSString *)viewName
{
return [CountlyViewTrackingInternal.sharedInstance startAutoStoppedView:viewName segmentation:nil];
}
- (NSString *)startAutoStoppedView:(NSString *)viewName segmentation:(NSDictionary *)segmentation;
{
return [CountlyViewTrackingInternal.sharedInstance startAutoStoppedView:viewName segmentation:segmentation];
}
- (NSString *)startView:(NSString *)viewName
{
return [CountlyViewTrackingInternal.sharedInstance startView:viewName segmentation:nil];
}
- (NSString *)startView:(NSString *)viewName segmentation:(NSDictionary *)segmentation;
{
return [CountlyViewTrackingInternal.sharedInstance startView:viewName segmentation:segmentation];
}
- (void)stopViewWithName:(NSString *)viewName
{
[CountlyViewTrackingInternal.sharedInstance stopViewWithName:viewName segmentation:nil];
}
- (void)stopViewWithName:(NSString *)viewName segmentation:(NSDictionary *)segmentation
{
[CountlyViewTrackingInternal.sharedInstance stopViewWithName:viewName segmentation:segmentation];
}
- (void)stopViewWithID:(NSString *)viewID
{
[CountlyViewTrackingInternal.sharedInstance stopViewWithID:viewID segmentation:nil];
}
- (void)stopViewWithID:(NSString *)viewID segmentation:(NSDictionary *)segmentation
{
[CountlyViewTrackingInternal.sharedInstance stopViewWithID:viewID segmentation:segmentation];
}
- (void)pauseViewWithID:(NSString *)viewID
{
[CountlyViewTrackingInternal.sharedInstance pauseViewWithID:viewID];
}
- (void)resumeViewWithID:(NSString *)viewID
{
[CountlyViewTrackingInternal.sharedInstance resumeViewWithID:viewID];
}
- (void)stopAllViews:(NSDictionary *)segmentation
{
[CountlyViewTrackingInternal.sharedInstance stopAllViews:segmentation];
}
- (void)addSegmentationToViewWithID:(NSString *)viewID segmentation:(NSDictionary *)segmentation
{
[CountlyViewTrackingInternal.sharedInstance addSegmentationToViewWithID:viewID segmentation:segmentation];
}
- (void)addSegmentationToViewWithName:(NSString *)viewName segmentation:(NSDictionary *)segmentation
{
[CountlyViewTrackingInternal.sharedInstance addSegmentationToViewWithName:viewName segmentation:segmentation];
}
@end