Commit ed064ed2 authored by jz's avatar jz

add expo

parent d67a9dd6
......@@ -42,6 +42,9 @@
if (self.needExpo) {
self.view.pageCtrl = self;
[GMExposureManager fetchViewForVisibleState:self.view trackerType:GMViewTrackerTypeUIViewDidAppear recursive:YES];
if (self.needImmediatelySend) {
[GMExposureManager.sharedManager uploadExposureDataForPage:self];
}
}
}
......@@ -66,7 +69,11 @@
if (scrollView.pageCtrl.needExpo && !decelerate) {
[scrollView calculateUpOrDownTimes];
[GMExposureManager fetchViewForVisibleState:scrollView trackerType:GMViewTrackerTypeUIScrollDragging recursive:YES];
if (self.needImmediatelySend) {
[GMExposureManager.sharedManager endExpoTrcakerForPageCtrl:self];
}
}
//NSLog(@"%@:%zd--%zd",scrollView.pageCtrl,scrollView.pageCtrl.down_slide_times,scrollView.pageCtrl.up_slide_times);
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
......@@ -75,11 +82,22 @@
[scrollView calculateUpOrDownTimes];
[GMExposureManager fetchViewForVisibleState:scrollView trackerType:GMViewTrackerTypeUIScrollDragging recursive:YES];
if (self.needImmediatelySend) {
[GMExposureManager.sharedManager endExpoTrcakerForPageCtrl:self];
}
}
}
#pragma mark - GMPageExposureProtocol
- (void)setNeedImmediatelySend:(BOOL)needImmediatelySend {
objc_setAssociatedObject(self, @selector(needImmediatelySend), @(needImmediatelySend), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (BOOL)needImmediatelySend {
return [objc_getAssociatedObject(self, @selector(needImmediatelySend)) boolValue];
}
- (void)setNeedExpo:(BOOL)needExpo {
objc_setAssociatedObject(self, @selector(needExpo), @(needExpo), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
......@@ -98,6 +116,7 @@
- (void)setDown_slide_times:(NSInteger)down_slide_times {
objc_setAssociatedObject(self, @selector(down_slide_times), @(down_slide_times), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (NSInteger)down_slide_times {
......@@ -114,6 +133,7 @@
- (void)setDown_loading_times:(NSInteger)down_loading_times {
objc_setAssociatedObject(self, @selector(down_loading_times), @(down_loading_times), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (NSInteger)down_loading_times {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment