Skip to content

Commit

Permalink
Release 3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhujg-00 committed Aug 18, 2021
1 parent 71fe45f commit b2278ec
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 27 deletions.
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SensorsAnalyticsSDK"
s.version = "3.1.1"
s.version = "3.1.2"
s.summary = "The official iOS SDK of Sensors Analytics."
s.homepage = "http://www.sensorsdata.cn"
s.source = { :git => 'https://github.com/sensorsdata/sa-sdk-ios.git', :tag => "v#{s.version}" }
Expand Down
8 changes: 4 additions & 4 deletions SensorsAnalyticsSDK/AutoTrack/AppClick/UIView+AutoTrack.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ - (NSString *)sensorsdata_elementContent {
}

- (NSString *)sensorsdata_elementPosition {
UIView *superview = self.superview;
if (superview && superview.sensorsdata_elementPosition) {
return superview.sensorsdata_elementPosition;
UIView *superView = self.superview;
if (!superView) {
return nil;
}
return nil;
return superView.sensorsdata_elementPosition;
}

- (NSString *)sensorsdata_elementId {
Expand Down
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/Core/SAModuleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ - (void)setEnable:(BOOL)enable forModule:(NSString *)moduleName {
} else {
NSString *className = [self classNameForModule:moduleName];
Class<SAModuleProtocol> cla = NSClassFromString(className);
NSAssert(cla, @"\n您使用接口开启了 %@ 模块,但是并没有集成该模块。\n • 如果使用源码集成神策分析 iOS SDK,请检查是否包含名为 %@ 的文件?\n • 如果使用 CocoaPods 集成 SDK,请修改 Podfile 文件,增加 %@ 模块的 subspec,例如:pod 'SensorsAnalyticsSDK', :subspecs => ['%@']。\n", moduleName, className, moduleName, moduleName);
NSAssert(cla, @"\n您使用接口开启了 %@ 模块,但是并没有集成该模块。\n • 如果使用源码集成神策分析 iOS SDK,请检查是否包含名为 %@ 的文件?\n • 如果使用 CocoaPods 集成 SDK,请修改 Podfile 文件,增加 %@ 模块的 subspec,例如:pod 'SensorsAnalyticsSDK', :subspecs => ['Core', '%@']。\n", moduleName, className, moduleName, moduleName);
if ([cla conformsToProtocol:@protocol(SAModuleProtocol)]) {
id<SAModuleProtocol> object = [[(Class)cla alloc] init];
if ([object respondsToSelector:@selector(setConfigOptions:)]) {
Expand Down
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#import "SAProfileEventObject.h"
#import "SAJSONUtil.h"

#define VERSION @"3.1.1"
#define VERSION @"3.1.2"

void *SensorsAnalyticsQueueTag = &SensorsAnalyticsQueueTag;

Expand Down
47 changes: 27 additions & 20 deletions SensorsAnalyticsSDK/Visualized/ElementPath/UIView+SAElementPath.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ - (NSString *)sensorsdata_heatMapPath {
- (NSString *)sensorsdata_similarPath {
// 是否支持限定元素位置功能
BOOL enableSupportSimilarPath = [NSStringFromClass(self.class) isEqualToString:@"UITabBarButton"];
if (self.sensorsdata_elementPosition && enableSupportSimilarPath) {
NSString *similarPath = [NSString stringWithFormat:@"%@[-]",NSStringFromClass(self.class)];
return similarPath;
if (enableSupportSimilarPath && self.sensorsdata_elementPosition) {
return [NSString stringWithFormat:@"%@[-]",NSStringFromClass(self.class)];
} else {
return self.sensorsdata_itemPath;
}
Expand Down Expand Up @@ -650,22 +649,25 @@ - (NSIndexPath *)sensorsdata_IndexPath {
#pragma mark SAAutoTrackViewPathProperty

- (NSString *)sensorsdata_itemPath {
if (self.sensorsdata_IndexPath) {
return [self sensorsdata_itemPathWithIndexPath:self.sensorsdata_IndexPath];
NSIndexPath *indexPath = self.sensorsdata_IndexPath;
if (indexPath) {
return [self sensorsdata_itemPathWithIndexPath:indexPath];
}
return [super sensorsdata_itemPath];
}

- (NSString *)sensorsdata_similarPath {
if (self.sensorsdata_IndexPath) {
return [self sensorsdata_similarPathWithIndexPath:self.sensorsdata_IndexPath];
NSIndexPath *indexPath = self.sensorsdata_IndexPath;
if (indexPath) {
return [self sensorsdata_similarPathWithIndexPath:indexPath];
}
return self.sensorsdata_itemPath;
}

- (NSString *)sensorsdata_heatMapPath {
if (self.sensorsdata_IndexPath) {
return [self sensorsdata_itemPathWithIndexPath:self.sensorsdata_IndexPath];
NSIndexPath *indexPath = self.sensorsdata_IndexPath;
if (indexPath) {
return [self sensorsdata_itemPathWithIndexPath:indexPath];
}
return [super sensorsdata_heatMapPath];
}
Expand All @@ -680,8 +682,9 @@ - (NSString *)sensorsdata_similarPathWithIndexPath:(NSIndexPath *)indexPath {

#pragma mark SAAutoTrackViewProperty
- (NSString *)sensorsdata_elementPosition {
if (self.sensorsdata_IndexPath) {
return [[NSString alloc] initWithFormat:@"%ld:%ld", (long)self.sensorsdata_IndexPath.section, (long)self.sensorsdata_IndexPath.row];
NSIndexPath *indexPath = self.sensorsdata_IndexPath;
if (indexPath) {
return [NSString stringWithFormat:@"%ld:%ld", (long)indexPath.section, (long)indexPath.row];
}
return nil;
}
Expand All @@ -705,23 +708,26 @@ - (NSIndexPath *)sensorsdata_IndexPath {

#pragma mark SAAutoTrackViewPathProperty
- (NSString *)sensorsdata_itemPath {
if (self.sensorsdata_IndexPath) {
return [self sensorsdata_itemPathWithIndexPath:self.sensorsdata_IndexPath];
NSIndexPath *indexPath = self.sensorsdata_IndexPath;
if (indexPath) {
return [self sensorsdata_itemPathWithIndexPath:indexPath];
}
return [super sensorsdata_itemPath];
}

- (NSString *)sensorsdata_similarPath {
if (self.sensorsdata_IndexPath) {
return [self sensorsdata_similarPathWithIndexPath:self.sensorsdata_IndexPath];
NSIndexPath *indexPath = self.sensorsdata_IndexPath;
if (indexPath) {
return [self sensorsdata_similarPathWithIndexPath:indexPath];
} else {
return super.sensorsdata_similarPath;
}
}

- (NSString *)sensorsdata_heatMapPath {
if (self.sensorsdata_IndexPath) {
return [self sensorsdata_itemPathWithIndexPath:self.sensorsdata_IndexPath];
NSIndexPath *indexPath = self.sensorsdata_IndexPath;
if (indexPath) {
return [self sensorsdata_itemPathWithIndexPath:indexPath];
}
return [super sensorsdata_heatMapPath];
}
Expand All @@ -744,9 +750,10 @@ - (NSString *)sensorsdata_elementPosition {
if (!elementInfo.isSupportElementPosition) {
return nil;
}

if (self.sensorsdata_IndexPath) {
return [[NSString alloc] initWithFormat:@"%ld:%ld", (long)self.sensorsdata_IndexPath.section, (long)self.sensorsdata_IndexPath.item];

NSIndexPath *indexPath = self.sensorsdata_IndexPath;
if (indexPath) {
return [NSString stringWithFormat:@"%ld:%ld", (long)indexPath.section, (long)indexPath.item];
}
return nil;
}
Expand Down

0 comments on commit b2278ec

Please sign in to comment.