Authored by 曹镏

no message

@@ -894,6 +894,7 @@ @@ -894,6 +894,7 @@
894 E7E311C71A84C6DF004DB7DF /* Release */, 894 E7E311C71A84C6DF004DB7DF /* Release */,
895 ); 895 );
896 defaultConfigurationIsVisible = 0; 896 defaultConfigurationIsVisible = 0;
  897 + defaultConfigurationName = Release;
897 }; 898 };
898 E7E311CC1A84C6DF004DB7DF /* Build configuration list for PBXNativeTarget "YHAnalyticsTests" */ = { 899 E7E311CC1A84C6DF004DB7DF /* Build configuration list for PBXNativeTarget "YHAnalyticsTests" */ = {
899 isa = XCConfigurationList; 900 isa = XCConfigurationList;
@@ -902,6 +903,7 @@ @@ -902,6 +903,7 @@
902 E7E311C91A84C6DF004DB7DF /* Release */, 903 E7E311C91A84C6DF004DB7DF /* Release */,
903 ); 904 );
904 defaultConfigurationIsVisible = 0; 905 defaultConfigurationIsVisible = 0;
  906 + defaultConfigurationName = Release;
905 }; 907 };
906 /* End XCConfigurationList section */ 908 /* End XCConfigurationList section */
907 }; 909 };
@@ -34,6 +34,20 @@ @@ -34,6 +34,20 @@
34 ReferencedContainer = "container:YH_Analytics.xcodeproj"> 34 ReferencedContainer = "container:YH_Analytics.xcodeproj">
35 </BuildableReference> 35 </BuildableReference>
36 </BuildActionEntry> 36 </BuildActionEntry>
  37 + <BuildActionEntry
  38 + buildForTesting = "YES"
  39 + buildForRunning = "YES"
  40 + buildForProfiling = "NO"
  41 + buildForArchiving = "NO"
  42 + buildForAnalyzing = "YES">
  43 + <BuildableReference
  44 + BuildableIdentifier = "primary"
  45 + BlueprintIdentifier = "E7E311B61A84C6DF004DB7DF"
  46 + BuildableName = "YHAnalyticsTests.xctest"
  47 + BlueprintName = "YHAnalyticsTests"
  48 + ReferencedContainer = "container:YH_Analytics.xcodeproj">
  49 + </BuildableReference>
  50 + </BuildActionEntry>
37 </BuildActionEntries> 51 </BuildActionEntries>
38 </BuildAction> 52 </BuildAction>
39 <TestAction 53 <TestAction
@@ -52,6 +66,16 @@ @@ -52,6 +66,16 @@
52 ReferencedContainer = "container:YH_Analytics.xcodeproj"> 66 ReferencedContainer = "container:YH_Analytics.xcodeproj">
53 </BuildableReference> 67 </BuildableReference>
54 </TestableReference> 68 </TestableReference>
  69 + <TestableReference
  70 + skipped = "NO">
  71 + <BuildableReference
  72 + BuildableIdentifier = "primary"
  73 + BlueprintIdentifier = "E7E311B61A84C6DF004DB7DF"
  74 + BuildableName = "YHAnalyticsTests.xctest"
  75 + BlueprintName = "YHAnalyticsTests"
  76 + ReferencedContainer = "container:YH_Analytics.xcodeproj">
  77 + </BuildableReference>
  78 + </TestableReference>
55 </Testables> 79 </Testables>
56 <MacroExpansion> 80 <MacroExpansion>
57 <BuildableReference 81 <BuildableReference
@@ -22,6 +22,16 @@ @@ -22,6 +22,16 @@
22 <key>primary</key> 22 <key>primary</key>
23 <true/> 23 <true/>
24 </dict> 24 </dict>
  25 + <key>E7E311AC1A84C6DF004DB7DF</key>
  26 + <dict>
  27 + <key>primary</key>
  28 + <true/>
  29 + </dict>
  30 + <key>E7E311B61A84C6DF004DB7DF</key>
  31 + <dict>
  32 + <key>primary</key>
  33 + <true/>
  34 + </dict>
25 </dict> 35 </dict>
26 </dict> 36 </dict>
27 </plist> 37 </plist>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 // Override point for customization after application launch. 20 // Override point for customization after application launch.
21 21
22 // 设置发送策略 22 // 设置发送策略
23 - [YH_Analytics shareInstance].logStrategy = LogStrategyCustom; 23 +// [YH_Analytics shareInstance].logStrategy = LogStrategyCustom;
24 24
25 // 自定义发送时间,从服务器获取 25 // 自定义发送时间,从服务器获取
26 [YH_Analytics shareInstance].customInterval = 10; 26 [YH_Analytics shareInstance].customInterval = 10;
@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
31 // 启动 31 // 启动
32 [[YH_Analytics shareInstance]startWithAppId:@"appid"]; 32 [[YH_Analytics shareInstance]startWithAppId:@"appid"];
33 33
  34 + NSLog(@"logStrategy == %d", [YH_Analytics shareInstance].logStrategy);
34 return YES; 35 return YES;
35 } 36 }
36 37
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc"> 2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14C94b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
3 <dependencies> 3 <dependencies>
4 <deployment identifier="iOS"/> 4 <deployment identifier="iOS"/>
5 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/> 5 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
6 </dependencies> 6 </dependencies>
7 <scenes> 7 <scenes>
8 <!--View Controller--> 8 <!--View Controller-->
@@ -17,9 +17,30 @@ @@ -17,9 +17,30 @@
17 <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> 17 <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 18 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
19 <subviews> 19 <subviews>
20 - <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bwP-V2-lOZ">  
21 - <rect key="frame" x="5" y="144" width="338" height="97"/> 20 + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gW0-dg-TMX">
  21 + <rect key="frame" x="10" y="20" width="580" height="100"/>
  22 + <color key="backgroundColor" red="0.050306309830072005" green="0.82026833496787488" blue="1" alpha="1" colorSpace="calibratedRGB"/>
  23 + <constraints>
  24 + <constraint firstAttribute="height" constant="100" id="ZI4-PW-uqg"/>
  25 + </constraints>
  26 + <fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
  27 + <state key="normal" title="Event">
  28 + <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
  29 + <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
  30 + </state>
  31 + <variation key="heightClass=regular-widthClass=compact" fixedFrame="YES">
  32 + <rect key="frame" x="0.0" y="28" width="400" height="97"/>
  33 + </variation>
  34 + <connections>
  35 + <action selector="click:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="HJw-eR-F41"/>
  36 + </connections>
  37 + </button>
  38 + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bwP-V2-lOZ">
  39 + <rect key="frame" x="10" y="130" width="580" height="100"/>
22 <color key="backgroundColor" red="1" green="0.69311940380909554" blue="0.023097386693144983" alpha="1" colorSpace="calibratedRGB"/> 40 <color key="backgroundColor" red="1" green="0.69311940380909554" blue="0.023097386693144983" alpha="1" colorSpace="calibratedRGB"/>
  41 + <constraints>
  42 + <constraint firstAttribute="height" constant="100" id="NoZ-Je-4qr"/>
  43 + </constraints>
23 <fontDescription key="fontDescription" type="boldSystem" pointSize="34"/> 44 <fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
24 <state key="normal" title="Error"> 45 <state key="normal" title="Error">
25 <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> 46 <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
@@ -32,9 +53,12 @@ @@ -32,9 +53,12 @@
32 <action selector="error:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="a4Q-aL-zxj"/> 53 <action selector="error:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="a4Q-aL-zxj"/>
33 </connections> 54 </connections>
34 </button> 55 </button>
35 - <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ewb-Ni-v83">  
36 - <rect key="frame" x="5" y="251" width="338" height="97"/> 56 + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ewb-Ni-v83">
  57 + <rect key="frame" x="10" y="240" width="580" height="100"/>
37 <color key="backgroundColor" red="1" green="0.029765881059811372" blue="0.12144865843591712" alpha="1" colorSpace="calibratedRGB"/> 58 <color key="backgroundColor" red="1" green="0.029765881059811372" blue="0.12144865843591712" alpha="1" colorSpace="calibratedRGB"/>
  59 + <constraints>
  60 + <constraint firstAttribute="height" constant="100" id="b7r-yi-EcF"/>
  61 + </constraints>
38 <fontDescription key="fontDescription" type="boldSystem" pointSize="34"/> 62 <fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>
39 <state key="normal" title="Crash"> 63 <state key="normal" title="Crash">
40 <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> 64 <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
@@ -47,47 +71,56 @@ @@ -47,47 +71,56 @@
47 <action selector="crash:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Yi6-az-zUt"/> 71 <action selector="crash:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Yi6-az-zUt"/>
48 </connections> 72 </connections>
49 </button> 73 </button>
50 - <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gW0-dg-TMX">  
51 - <rect key="frame" x="5" y="11" width="338" height="97"/>  
52 - <color key="backgroundColor" red="0.050306309830072005" green="0.82026833496787488" blue="1" alpha="1" colorSpace="calibratedRGB"/>  
53 - <fontDescription key="fontDescription" type="boldSystem" pointSize="34"/>  
54 - <state key="normal" title="Event">  
55 - <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>  
56 - <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>  
57 - </state>  
58 - <variation key="heightClass=regular-widthClass=compact" fixedFrame="YES">  
59 - <rect key="frame" x="0.0" y="28" width="400" height="97"/>  
60 - </variation> 74 + <segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="nAu-Ws-BbT">
  75 + <rect key="frame" x="161" y="527" width="278" height="29"/>
  76 + <constraints>
  77 + <constraint firstAttribute="height" constant="28" id="lfj-dM-l64"/>
  78 + </constraints>
  79 + <segments>
  80 + <segment title="启动发送"/>
  81 + <segment title="间隔时间发送"/>
  82 + <segment title="立即发送"/>
  83 + </segments>
61 <connections> 84 <connections>
62 - <action selector="click:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="HJw-eR-F41"/> 85 + <action selector="segmentClick:" destination="vXZ-lx-hvc" eventType="valueChanged" id="Zsu-qi-jNA"/>
63 </connections> 86 </connections>
64 - </button>  
65 - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zcx-JR-zO7">  
66 - <rect key="frame" x="0.0" y="0.0" width="240" height="128"/>  
67 - <variation key="heightClass=regular-widthClass=compact" fixedFrame="YES">  
68 - <rect key="frame" x="13" y="349" width="375" height="262"/>  
69 - </variation>  
70 - </imageView> 87 + </segmentedControl>
71 </subviews> 88 </subviews>
72 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> 89 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
  90 + <constraints>
  91 + <constraint firstItem="bwP-V2-lOZ" firstAttribute="top" secondItem="gW0-dg-TMX" secondAttribute="bottom" constant="8" id="1aJ-tt-QeY"/>
  92 + <constraint firstItem="gW0-dg-TMX" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" id="4N3-W1-Guz"/>
  93 + <constraint firstAttribute="trailing" secondItem="gW0-dg-TMX" secondAttribute="trailing" constant="10" id="9Nj-U5-cTm"/>
  94 + <constraint firstItem="ewb-Ni-v83" firstAttribute="top" secondItem="bwP-V2-lOZ" secondAttribute="bottom" constant="10" id="9f1-iX-d2x"/>
  95 + <constraint firstItem="bwP-V2-lOZ" firstAttribute="top" secondItem="gW0-dg-TMX" secondAttribute="bottom" constant="10" id="CIg-AA-tZq"/>
  96 + <constraint firstAttribute="trailing" secondItem="ewb-Ni-v83" secondAttribute="trailing" constant="10" id="OJg-v6-WQP"/>
  97 + <constraint firstItem="ewb-Ni-v83" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="10" id="Pfw-gK-Ojb"/>
  98 + <constraint firstItem="ewb-Ni-v83" firstAttribute="top" secondItem="bwP-V2-lOZ" secondAttribute="bottom" constant="8" id="Rtg-70-QXv"/>
  99 + <constraint firstAttribute="centerX" secondItem="nAu-Ws-BbT" secondAttribute="centerX" id="abS-HB-PCF"/>
  100 + <constraint firstItem="bwP-V2-lOZ" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="10" id="ear-Q6-Cvo"/>
  101 + <constraint firstItem="ewb-Ni-v83" firstAttribute="top" secondItem="bwP-V2-lOZ" secondAttribute="bottom" constant="10" id="en3-RB-i3r"/>
  102 + <constraint firstAttribute="trailing" secondItem="bwP-V2-lOZ" secondAttribute="trailing" constant="10" id="tK7-Cs-ypv"/>
  103 + <constraint firstItem="bwP-V2-lOZ" firstAttribute="top" secondItem="gW0-dg-TMX" secondAttribute="bottom" constant="10" id="tgA-RV-Qfw"/>
  104 + <constraint firstItem="2fi-mo-0CV" firstAttribute="top" secondItem="nAu-Ws-BbT" secondAttribute="bottom" constant="45" id="u0B-Yk-3Eh"/>
  105 + <constraint firstItem="gW0-dg-TMX" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="10" id="vdS-6K-JkS"/>
  106 + </constraints>
73 <variation key="default"> 107 <variation key="default">
74 - <mask key="subviews">  
75 - <exclude reference="zcx-JR-zO7"/>  
76 - </mask>  
77 - </variation>  
78 - <variation key="heightClass=regular-widthClass=compact">  
79 - <mask key="subviews">  
80 - <include reference="zcx-JR-zO7"/> 108 + <mask key="constraints">
  109 + <exclude reference="1aJ-tt-QeY"/>
  110 + <exclude reference="tgA-RV-Qfw"/>
  111 + <exclude reference="9f1-iX-d2x"/>
  112 + <exclude reference="Rtg-70-QXv"/>
81 </mask> 113 </mask>
82 </variation> 114 </variation>
83 </view> 115 </view>
  116 + <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
84 <connections> 117 <connections>
85 - <outlet property="imageView" destination="zcx-JR-zO7" id="xDL-m6-TXH"/> 118 + <outlet property="segment" destination="nAu-Ws-BbT" id="Rgd-K0-bFJ"/>
86 </connections> 119 </connections>
87 </viewController> 120 </viewController>
88 <placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/> 121 <placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
89 </objects> 122 </objects>
90 - <point key="canvasLocation" x="-289.5" y="235.5"/> 123 + <point key="canvasLocation" x="-290" y="235"/>
91 </scene> 124 </scene>
92 </scenes> 125 </scenes>
93 </document> 126 </document>
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <key>CFBundleExecutable</key> 7 <key>CFBundleExecutable</key>
8 <string>$(EXECUTABLE_NAME)</string> 8 <string>$(EXECUTABLE_NAME)</string>
9 <key>CFBundleIdentifier</key> 9 <key>CFBundleIdentifier</key>
10 - <string>cn.yoho.show</string> 10 + <string>cn.yoho.test</string>
11 <key>CFBundleInfoDictionaryVersion</key> 11 <key>CFBundleInfoDictionaryVersion</key>
12 <string>6.0</string> 12 <string>6.0</string>
13 <key>CFBundleName</key> 13 <key>CFBundleName</key>
@@ -13,7 +13,8 @@ @@ -13,7 +13,8 @@
13 - (IBAction)click:(id)sender; 13 - (IBAction)click:(id)sender;
14 - (IBAction)error:(id)sender; 14 - (IBAction)error:(id)sender;
15 - (IBAction)crash:(id)sender; 15 - (IBAction)crash:(id)sender;
16 -@property (strong, nonatomic) IBOutlet UIImageView *imageView; 16 +@property (weak, nonatomic) IBOutlet UIImageView *imageView;
  17 +@property (weak, nonatomic) IBOutlet UISegmentedControl *segment;
17 18
18 @end 19 @end
19 20
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 [super viewDidLoad]; 23 [super viewDidLoad];
24 24
25 [self.imageView setImage:[UIImage imageNamed:@"stastsold"]]; 25 [self.imageView setImage:[UIImage imageNamed:@"stastsold"]];
26 - 26 + self.segment.selectedSegmentIndex = [YH_Analytics shareInstance].logStrategy;
27 } 27 }
28 28
29 29
@@ -65,6 +65,42 @@ @@ -65,6 +65,42 @@
65 NSString * string= [arr objectAtIndex: 2]; 65 NSString * string= [arr objectAtIndex: 2];
66 } 66 }
67 67
  68 +-(IBAction)segmentClick:(UISegmentedControl *)Seg {
  69 +
  70 + NSInteger index = Seg.selectedSegmentIndex;
  71 +
  72 + NSLog(@"Index %li", (long)index);
  73 +
  74 + switch (index) {
  75 +
  76 + case 0:
  77 +
  78 + [YH_Analytics shareInstance].logStrategy = LogStrategyAppLaunch;
  79 +
  80 +
  81 + break;
  82 +
  83 + case 1:
  84 + [YH_Analytics shareInstance].logStrategy = LogStrategyCustom;
  85 +
  86 + break;
  87 +
  88 + case 2:
  89 +
  90 + [YH_Analytics shareInstance].logStrategy = LogStrategyImmedi;;
  91 +
  92 +
  93 + break;
  94 +
  95 +
  96 + default:
  97 +
  98 + break;
  99 +
  100 + }
  101 +
  102 +}
  103 +
68 104
69 105
70 @end 106 @end
@@ -77,4 +77,6 @@ typedef enum _YohoMobStatLogStrategy { @@ -77,4 +77,6 @@ typedef enum _YohoMobStatLogStrategy {
77 */ 77 */
78 @property (strong, nonatomic) NSString *uid; 78 @property (strong, nonatomic) NSString *uid;
79 79
  80 +
  81 +
80 @end 82 @end
@@ -573,5 +573,17 @@ static dispatch_queue_t persisitingQueue; @@ -573,5 +573,17 @@ static dispatch_queue_t persisitingQueue;
573 } 573 }
574 574
575 575
  576 +-(void)setLogStrategy:(YHLogStrategy)strategyNumber
  577 +{
  578 + NSUserDefaults *strategy = [NSUserDefaults standardUserDefaults];
  579 + [strategy setObject: [NSNumber numberWithInteger:strategyNumber] forKey:@"LOGSTRATEGY"];
  580 + [strategy synchronize];
  581 +}
576 582
  583 +-(YHLogStrategy)logStrategy
  584 +{
  585 + NSUserDefaults *strategy = [NSUserDefaults standardUserDefaults];
  586 + NSNumber * strategyObj = [strategy objectForKey:@"LOGSTRATEGY"];
  587 + return [strategyObj intValue];
  588 +}
577 @end 589 @end