Authored by John Tai

Merge branch 'develop' of http://git.yoho.cn/mobile/YH_EventReport into develop

... ... @@ -159,9 +159,9 @@ static NSArray *kYHEventReportIgnoredViewControllerArray;
self.performanceTrackEnabled = YES;
[UIViewController startTrack];
[UITabBar startTrack];
[UIControl startTrack];
[UITapGestureRecognizer startTrack];
//[NSURLConnection startTrack];
// [UIControl startTrack];
// [UITapGestureRecognizer startTrack];
// [NSURLConnection startTrack];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIWebView startTrack];
... ...
... ... @@ -14,25 +14,9 @@
#import "YHLog.h"
#import "YHEventReport.h"
static const void *yher_actionHandlerBlock = &yher_actionHandlerBlock;
@interface SDWebImageManager()
@property (nonatomic, copy) SDWebImageCompletionWithFinishedBlock actionHandlerBlock;
@end
@implementation SDWebImageManager (AutoTrack)
#pragma mark - 属性
- (SDWebImageCompletionWithFinishedBlock)actionHandlerBlock{
return objc_getAssociatedObject(self, @selector(actionHandlerBlock));
}
- (void)setActionHandlerBlock:(SDWebImageCompletionWithFinishedBlock)actionHandlerBlock{
objc_setAssociatedObject(self, @selector(actionHandlerBlock), actionHandlerBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
- (void)setYh_webImageId:(NSString *)yh_webImageId{
objc_setAssociatedObject(self,@selector(yh_webImageId),yh_webImageId,OBJC_ASSOCIATION_RETAIN);
... ... @@ -67,7 +51,6 @@ static const void *yher_actionHandlerBlock = &yher_actionHandlerBlock;
progress:(SDWebImageDownloaderProgressBlock)progressBlock
completed:(SDWebImageCompletionWithFinishedBlock)completedBlock
{
objc_setAssociatedObject(self, yher_actionHandlerBlock, completedBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
if ([YHEventReport sharedInstance].isPerformanceTrackEnabled && [YHEventReport sharedInstance].isImagePerformanceTrackEnable){
[[YH_EventCollector sharedInstance] timeEventStartWithWebImageDownload:self];
... ... @@ -85,9 +68,8 @@ static const void *yher_actionHandlerBlock = &yher_actionHandlerBlock;
}
}
SDWebImageCompletionWithFinishedBlock actionHandlerBlock = objc_getAssociatedObject(self, yher_actionHandlerBlock);
if (actionHandlerBlock) {
actionHandlerBlock(image,error,cacheType,finished,imageURL);
if (completedBlock) {
completedBlock(image,error,cacheType,finished,imageURL);
}
}];
}
... ...
... ... @@ -10,4 +10,6 @@
@interface UIImageView (GestureAutoTrack)
+ (void)startTrack;
@end
... ...
... ... @@ -18,7 +18,7 @@
@implementation UIImageView (GestureAutoTrack)
+ (void)load {
+ (void)startTrack {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
@try {
... ...
... ... @@ -10,4 +10,6 @@
@interface UILabel (GestureAutoTrack)
+ (void)startTrack;
@end
... ...
... ... @@ -18,7 +18,7 @@
@implementation UILabel (GestureAutoTrack)
+ (void)load {
+ (void)startTrack {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
@try {
... ...