Commit c0eb4eff authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

Merge branch 'lmj_branch' into lmj_branch_unuse

# Conflicts:
#	superCleaner.xcodeproj/project.pbxproj
#	superCleaner/Home/Controller/ICHomeViewController.m
parents 14c7e0c6 a7323cee
This diff is collapsed.
${PODS_ROOT}/Target Support Files/Pods-superCleaner/Pods-superCleaner-resources.sh
${PODS_ROOT}/Bytedance-UnionAD/Bytedance-UnionAd/Frameworks/BUAdSDK.bundle
\ No newline at end of file
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BUAdSDK.bundle
\ No newline at end of file
${PODS_ROOT}/Target Support Files/Pods-superCleaner/Pods-superCleaner-resources.sh
${PODS_ROOT}/Bytedance-UnionAD/Bytedance-UnionAd/Frameworks/BUAdSDK.bundle
\ No newline at end of file
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BUAdSDK.bundle
\ No newline at end of file
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
# If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
# resources to, so exit 0 (signalling the script phase was successful).
exit 0
fi
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
case "${TARGETED_DEVICE_FAMILY:-}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
3)
TARGET_DEVICE_ARGS="--target-device tv"
;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH" || true
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_resource "${PODS_ROOT}/Bytedance-UnionAD/Bytedance-UnionAd/Frameworks/BUAdSDK.bundle"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_resource "${PODS_ROOT}/Bytedance-UnionAD/Bytedance-UnionAd/Frameworks/BUAdSDK.bundle"
fi
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find -L "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "${PODS_ROOT}*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
else
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
fi
fi
......@@ -125,7 +125,6 @@
A94C0E6424DA7044007F577D /* KeychainItemWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0DC224DA7044007F577D /* KeychainItemWrapper.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
A94C0E6524DA7044007F577D /* KeychainItemManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0DC424DA7044007F577D /* KeychainItemManager.m */; };
A94C0E6624DA7044007F577D /* Data.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0DC624DA7044007F577D /* Data.m */; };
A94C0E6724DA7044007F577D /* QJGIFView.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0DCA24DA7044007F577D /* QJGIFView.m */; };
A94C0E6824DA7044007F577D /* MBProgressHUD+MJ.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0DCB24DA7044007F577D /* MBProgressHUD+MJ.m */; };
A94C0E6924DA7044007F577D /* MBProgressHUD.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A94C0DCD24DA7044007F577D /* MBProgressHUD.bundle */; };
A94C0E6A24DA7044007F577D /* PYHDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0DD324DA7044007F577D /* PYHDocument.m */; };
......@@ -197,6 +196,8 @@
A94C0F6924DBF952007F577D /* AAChartModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0F4124DBF952007F577D /* AAChartModel.m */; };
A94C0F6A24DBF952007F577D /* AAOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0F4324DBF952007F577D /* AAOptions.m */; };
A94C0F6B24DBF952007F577D /* AASeriesElement.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0F4424DBF952007F577D /* AASeriesElement.m */; };
A94C0F6F24DC0606007F577D /* SCHomeHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = A94C0F6D24DC0606007F577D /* SCHomeHeaderView.m */; };
A94C0F7024DC0606007F577D /* SCHomeHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A94C0F6E24DC0606007F577D /* SCHomeHeaderView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
......@@ -391,9 +392,7 @@
A94C0DC624DA7044007F577D /* Data.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Data.m; sourceTree = "<group>"; };
A94C0DC724DA7044007F577D /* KeychainItemManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeychainItemManager.h; sourceTree = "<group>"; };
A94C0DC924DA7044007F577D /* MBProgressHUD+MJ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MBProgressHUD+MJ.h"; sourceTree = "<group>"; };
A94C0DCA24DA7044007F577D /* QJGIFView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QJGIFView.m; sourceTree = "<group>"; };
A94C0DCB24DA7044007F577D /* MBProgressHUD+MJ.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MBProgressHUD+MJ.m"; sourceTree = "<group>"; };
A94C0DCC24DA7044007F577D /* QJGIFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QJGIFView.h; sourceTree = "<group>"; };
A94C0DCD24DA7044007F577D /* MBProgressHUD.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = MBProgressHUD.bundle; sourceTree = "<group>"; };
A94C0DD024DA7044007F577D /* ICContactListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICContactListModel.h; sourceTree = "<group>"; };
A94C0DD124DA7044007F577D /* ICContactsBackup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICContactsBackup.h; sourceTree = "<group>"; };
......@@ -528,6 +527,9 @@
A94C0F4424DBF952007F577D /* AASeriesElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AASeriesElement.m; sourceTree = "<group>"; };
A94C0F4524DBF952007F577D /* AAChartView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAChartView.h; sourceTree = "<group>"; };
A94C0F4624DBF952007F577D /* AAChartModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAChartModel.h; sourceTree = "<group>"; };
A94C0F6C24DC0606007F577D /* SCHomeHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SCHomeHeaderView.h; sourceTree = "<group>"; };
A94C0F6D24DC0606007F577D /* SCHomeHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SCHomeHeaderView.m; sourceTree = "<group>"; };
A94C0F6E24DC0606007F577D /* SCHomeHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SCHomeHeaderView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -845,6 +847,9 @@
A94C0D9124DA7043007F577D /* WKSimilarPhotoCell.m */,
A94C0D9724DA7043007F577D /* WKSimilarPhotoHeadView.h */,
A94C0D9224DA7043007F577D /* WKSimilarPhotoHeadView.m */,
A94C0F6C24DC0606007F577D /* SCHomeHeaderView.h */,
A94C0F6D24DC0606007F577D /* SCHomeHeaderView.m */,
A94C0F6E24DC0606007F577D /* SCHomeHeaderView.xib */,
);
path = View;
sourceTree = "<group>";
......@@ -965,8 +970,6 @@
A94C0DCD24DA7044007F577D /* MBProgressHUD.bundle */,
A94C0DC924DA7044007F577D /* MBProgressHUD+MJ.h */,
A94C0DCB24DA7044007F577D /* MBProgressHUD+MJ.m */,
A94C0DCC24DA7044007F577D /* QJGIFView.h */,
A94C0DCA24DA7044007F577D /* QJGIFView.m */,
);
path = HUD;
sourceTree = "<group>";
......@@ -1267,6 +1270,7 @@
A94C0D0424DA69B3007F577D /* pets.mp3 in Resources */,
A94C0E2C24DA7044007F577D /* BatteryCareLocation.plist in Resources */,
A94C0E2F24DA7044007F577D /* ICBatteryCareMainTextViewCell.xib in Resources */,
A94C0F7024DC0606007F577D /* SCHomeHeaderView.xib in Resources */,
A94C0E7D24DA7044007F577D /* ICContactManageViewCell.xib in Resources */,
A94C0E2624DA7044007F577D /* BatteryCareNotification.plist in Resources */,
A94C0F6724DBF952007F577D /* AAJSFiles.bundle in Resources */,
......@@ -1391,6 +1395,7 @@
A94C0F5824DBF952007F577D /* AAPlotLinesElement.m in Sources */,
A94C0E4624DA7044007F577D /* ICNormalPhotoViewController.m in Sources */,
A94C0E2E24DA7044007F577D /* SCNetWorkDashBoardView.swift in Sources */,
A94C0F6F24DC0606007F577D /* SCHomeHeaderView.m in Sources */,
A94C0E2724DA7044007F577D /* ICDbTestViewController.m in Sources */,
A94C0E7324DA7044007F577D /* ICContactListViewController.m in Sources */,
A94C0E3424DA7044007F577D /* ICBatteryCareMainTextViewCell.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tongji-4.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
This diff is collapsed.
......@@ -10,6 +10,7 @@
#import "superCleaner-Swift.h"
#import "ICWebViewController.h"
#import "ICIPAProductModel.h"
#import "Data.h"
@interface ICIAPViewController ()
......@@ -48,6 +49,13 @@
UITapGestureRecognizer *yearTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectedYearAction)];
[self.yearContentView addGestureRecognizer: yearTap];
self.weakPriceLabel.text = @"3天免费试用,之后";
Data * data = [[Data alloc] init];
NSDictionary * dic = [[data Read] objectForKey:@"config"];
if (dic) {
self.weakPriceLabel.text = [dic objectForKey:@"pay_3day_txt"];
}
self.products = [NSMutableArray array];
[self getIpaList];
......@@ -69,10 +77,8 @@
[weakSelf.products addObject:model];
if ([model.productId containsString:@"week"]) {
weakSelf.weakPeriodOfUseLabel.text = model.name;
weakSelf.weakPriceLabel.text = model.payDesc;
} else if ([model.productId containsString:@"year"]) {
weakSelf.yearPeriodOfUseLabel.text = model.name;
weakSelf.yearPriceLabel.text = [NSString stringWithFormat:@"%@ (%@)", model.payDesc, model.greyBgStr];
}
}
}
......
......@@ -201,9 +201,6 @@
[alertController addAction:([UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
completionHandler();
// self->_requestW = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:message]];
// [self.webView loadRequest:self->_requestW];
}])];
[self presentViewController:alertController animated:YES completion:nil];
}
......
......@@ -103,6 +103,39 @@
_similarPhotoContentView.backgroundColor = kMassColorAlpha(0.15);
_similarVideoContentView.backgroundColor = kMassColorAlpha(0.15);
_screenshotContentView.tag = 0x8c+1;
_livePhotoContentView.tag = 0x8c+3;
_similarPhotoContentView.tag = 0x8c;
_similarVideoContentView.tag = 0x8c+2;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapGes:)];
UITapGestureRecognizer * tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapGes:)];
UITapGestureRecognizer * tap2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapGes:)];
UITapGestureRecognizer * tap3 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapGes:)];
[_screenshotContentView addGestureRecognizer:tap];
[_livePhotoContentView addGestureRecognizer:tap1];
[_similarPhotoContentView addGestureRecognizer:tap2];
[_similarVideoContentView addGestureRecognizer:tap3];
}
- (void)viewTapGes:(UITapGestureRecognizer *)ges{
switch (ges.view.tag-0x8c) {
case 0:
[self similarPhotoDetailAction];
break;
case 1:
[self screenshotDetailAction];
break;
case 2:
break;
case 3:
[self livePhotoDetailAction];
break;
default:
break;
}
}
- (void)updateUI{
......
//
// SCHomeHeaderView.h
// superCleaner
//
// Created by 明津李 on 2020/8/6.
// Copyright © 2020 Mazy. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SCHomeHeaderView : UICollectionReusableView
@property (weak, nonatomic) IBOutlet UILabel *usedSpaceScaleLabel;
@property (weak, nonatomic) IBOutlet UILabel *spacePercentLabel;
@property (weak, nonatomic) IBOutlet UIButton *smartClearButton;
@property (weak, nonatomic) IBOutlet UIImageView *cycleImageView;
@property (weak, nonatomic) IBOutlet UIButton *manualButton;
@end
NS_ASSUME_NONNULL_END
//
// SCHomeHeaderView.m
// superCleaner
//
// Created by 明津李 on 2020/8/6.
// Copyright © 2020 Mazy. All rights reserved.
//
#import "SCHomeHeaderView.h"
@implementation SCHomeHeaderView
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionReusableView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="SCHomeHeaderView" id="U6b-Vx-4bR" customClass="SCHomeHeaderView">
<rect key="frame" x="0.0" y="0.0" width="415" height="350"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_cycle_bg_img" translatesAutoresizingMaskIntoConstraints="NO" id="Zv4-WU-omb">
<rect key="frame" x="109.5" y="25" width="196" height="196.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="Zv4-WU-omb" secondAttribute="height" id="8bM-lL-T2A"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="52.3/64 GB" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zHw-24-34Q">
<rect key="frame" x="170.5" y="241.5" width="74.5" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kdu-zn-cpc">
<rect key="frame" x="113.5" y="272.5" width="188" height="50"/>
<state key="normal" title="立即清理" backgroundImage="home_button_bg">
<color key="titleColor" red="0.20392156859999999" green="0.20392156859999999" blue="0.20392156859999999" alpha="1" colorSpace="calibratedRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="kMassColor" value="YES"/>
</userDefinedRuntimeAttributes>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1jd-Wk-3GP">
<rect key="frame" x="152" y="67.5" width="111" height="111"/>
<color key="backgroundColor" red="0.14901960780000001" green="0.74117647060000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" secondItem="1jd-Wk-3GP" secondAttribute="height" id="8Oy-XT-kKI"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<state key="normal">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="massBackgroundColor">
<color key="value" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
<stackView opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="ggP-Tm-Bko">
<rect key="frame" x="191" y="113.5" width="33.5" height="19.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="82%" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yC1-rk-Hns">
<rect key="frame" x="0.0" y="0.0" width="33.5" height="19.5"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<color key="textColor" red="0.1333333333" green="0.16078431369999999" blue="0.23921568630000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="ggP-Tm-Bko" firstAttribute="centerX" secondItem="1jd-Wk-3GP" secondAttribute="centerX" id="4Jk-2s-Isl"/>
<constraint firstItem="zHw-24-34Q" firstAttribute="centerX" secondItem="Zv4-WU-omb" secondAttribute="centerX" id="5lQ-Pu-Nbh"/>
<constraint firstItem="1jd-Wk-3GP" firstAttribute="centerY" secondItem="Zv4-WU-omb" secondAttribute="centerY" id="B66-oI-GDt"/>
<constraint firstItem="ggP-Tm-Bko" firstAttribute="centerX" secondItem="U6b-Vx-4bR" secondAttribute="centerX" id="CGu-e6-A6F"/>
<constraint firstItem="1jd-Wk-3GP" firstAttribute="centerX" secondItem="Zv4-WU-omb" secondAttribute="centerX" id="GUh-Om-2FR"/>
<constraint firstItem="zHw-24-34Q" firstAttribute="centerX" secondItem="U6b-Vx-4bR" secondAttribute="centerX" id="GjT-uU-6bX"/>
<constraint firstItem="Zv4-WU-omb" firstAttribute="top" secondItem="U6b-Vx-4bR" secondAttribute="top" constant="25" id="Gjn-0n-8YZ"/>
<constraint firstItem="1jd-Wk-3GP" firstAttribute="width" secondItem="Zv4-WU-omb" secondAttribute="width" multiplier="95:168" id="HQJ-iW-vZ9"/>
<constraint firstItem="kdu-zn-cpc" firstAttribute="centerX" secondItem="U6b-Vx-4bR" secondAttribute="centerX" id="HcD-OE-9YK"/>
<constraint firstItem="ggP-Tm-Bko" firstAttribute="centerY" secondItem="1jd-Wk-3GP" secondAttribute="centerY" id="Stx-Ch-vQ5"/>
<constraint firstItem="kdu-zn-cpc" firstAttribute="top" secondItem="zHw-24-34Q" secondAttribute="bottom" constant="14" id="Vb3-jJ-47a"/>
<constraint firstItem="zHw-24-34Q" firstAttribute="top" secondItem="Zv4-WU-omb" secondAttribute="bottom" constant="20" id="Vy1-Zq-bGV"/>
<constraint firstItem="Zv4-WU-omb" firstAttribute="width" secondItem="U6b-Vx-4bR" secondAttribute="width" multiplier="168:355" id="X6Y-WL-zDQ"/>
<constraint firstItem="Zv4-WU-omb" firstAttribute="width" secondItem="Zv4-WU-omb" secondAttribute="height" id="ZcV-l7-Tmo"/>
<constraint firstItem="kdu-zn-cpc" firstAttribute="centerX" secondItem="Zv4-WU-omb" secondAttribute="centerX" id="Zcs-zK-Anc"/>
<constraint firstItem="1jd-Wk-3GP" firstAttribute="centerX" secondItem="U6b-Vx-4bR" secondAttribute="centerX" id="gbh-51-ooP"/>
<constraint firstItem="1jd-Wk-3GP" firstAttribute="width" secondItem="1jd-Wk-3GP" secondAttribute="height" id="jjh-CL-fBu"/>
<constraint firstItem="Zv4-WU-omb" firstAttribute="centerX" secondItem="U6b-Vx-4bR" secondAttribute="centerX" id="ulc-67-RPm"/>
</constraints>
<viewLayoutGuide key="safeArea" id="9Gg-ye-v9C"/>
<connections>
<outlet property="cycleImageView" destination="Zv4-WU-omb" id="7R7-Y5-uew"/>
<outlet property="manualButton" destination="kdu-zn-cpc" id="TVz-VU-f4f"/>
<outlet property="smartClearButton" destination="1jd-Wk-3GP" id="MG6-5N-v0z"/>
<outlet property="spacePercentLabel" destination="zHw-24-34Q" id="MPT-Vt-mQ8"/>
<outlet property="usedSpaceScaleLabel" destination="yC1-rk-Hns" id="jN8-3G-tXo"/>
</connections>
<point key="canvasLocation" x="306.52173913043481" y="98.4375"/>
</collectionReusableView>
</objects>
<resources>
<image name="home_button_bg" width="188" height="50"/>
<image name="home_cycle_bg_img" width="168" height="168"/>
</resources>
</document>
......@@ -51,10 +51,16 @@ static ICUserManager * manager;
}
- (BOOL)isMember {
NSString *dateString = [[NSUserDefaults standardUserDefaults] valueForKeyPath:@"expiryDate"];
if (dateString.length <= 0) {
#ifdef DEBUG
return false;
#else
return self.model.isMember;
#endif
}
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd HH:mm";
NSDate *expiryDate = [formatter dateFromString:dateString];
......@@ -66,7 +72,6 @@ static ICUserManager * manager;
// else if ([expiryDate timeIntervalSinceDate:[NSDate date]] <= 0) {
// return false;
// }
return self.model.isMember;
}
......@@ -162,7 +167,11 @@ static ICUserManager * manager;
} else {
[data removeDicForKey:@"urlInfo"];
}
if ([[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"config"]) {
[data WirteDic:[[[response objectForKey:@"result"] objectForKey:@"data"] objectForKey:@"config"] Key:@"config"];
} else {
[data removeDicForKey:@"config"];
}
}
} failure:^(NSError * _Nonnull error) {
......@@ -171,5 +180,4 @@ static ICUserManager * manager;
}];
}
@end
......@@ -24,7 +24,7 @@ class ICPurchaseManager: NSObject {
case .success(let product):
print("Purchase Success: \(product.productId)")
let appleValidator = AppleReceiptValidator(service: .production, sharedSecret: "0dee7332e952467c97e5d4ecd1f788f6")
let appleValidator = AppleReceiptValidator(service: .production, sharedSecret: "ed0f68aca7964038a5cdf2a68c8c35c4")
let hud = MBProgressHUD.showAdded(to: inView, animated: true)
SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in
hud.hide(animated: true)
......@@ -230,7 +230,7 @@ class ICPurchaseManager: NSObject {
print("Restore sortedResults: \(sortedResults)")
if let purchase = sortedResults.last {
let appleValidator = AppleReceiptValidator(service: .production, sharedSecret: "0dee7332e952467c97e5d4ecd1f788f6")
let appleValidator = AppleReceiptValidator(service: .production, sharedSecret: "ed0f68aca7964038a5cdf2a68c8c35c4")
let hud = MBProgressHUD.showAdded(to: UIApplication.shared.delegate!.window!!, animated: true)
SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in
hud.hide(animated: true)
......
......@@ -11,6 +11,8 @@
@interface WMEventCalendarTool()
@property (nonatomic ,copy) completion completion;
@property (nonatomic ,copy) completion calendarCompletion;
@property (nonatomic ,copy) completed completed;
@property (nonatomic, strong) EKEventStore *eventStore;
......@@ -34,12 +36,12 @@
- (void)checkCalendarCanUsedCompletion:(completion)completion{
// EKEntityTypeEvent日历事件
// EKEntityTypeReminder提醒事项
self.completion = completion;
self.calendarCompletion = completion;
EKAuthorizationStatus eventStatus = [EKEventStore authorizationStatusForEntityType:EKEntityTypeEvent];
if (eventStatus == EKAuthorizationStatusAuthorized) {
// 已授权,可使用
if (self.completion) {
self.completion(YES, nil);
if (self.calendarCompletion) {
self.calendarCompletion(YES, nil);
}
}else if(eventStatus == EKAuthorizationStatusNotDetermined){
// 未进行授权选择
......@@ -54,16 +56,16 @@
NSLog(@"用户没有点允许访问日历");
}
dispatch_async(dispatch_get_main_queue(), ^{
if(self.completion){
self.completion(isGranted, isError);
if(self.calendarCompletion){
self.calendarCompletion(isGranted, isError);
}
});
}];
}else{
// 未授权
NSError *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:@{NSLocalizedDescriptionKey : @"未授权"}];
if (self.completion) {
self.completion(NO, error);
if (self.calendarCompletion) {
self.calendarCompletion(NO, error);
}
}
}
......@@ -404,7 +406,10 @@
- (void)checkCompletedRemindersStartDate:(NSDate *)startDate addEndDate:(NSDate *)endDate fetchCompleted: (completed)completed {
self.completed = completed;
// 查询到所有的日历
NSArray *tempA = [self.eventStore calendarsForEntityType: EKEntityTypeReminder];
EKEventStore * store = [[EKEventStore alloc] init];
NSArray *tempA = [store calendarsForEntityType: EKEntityTypeReminder];
NSMutableArray *only3D = [NSMutableArray array];
for (int i = 0 ; i < tempA.count; i ++) {
......@@ -416,7 +421,7 @@
[only3D addObject: temCalendar];
}
}
self.eventStore = store;
NSPredicate *predicate = [self.eventStore predicateForCompletedRemindersWithCompletionDateStarting:startDate ending:endDate calendars:only3D];
// 获取到范围内的所有事件
......
......@@ -16,7 +16,8 @@
@property (nonatomic, strong) WKClearPhotoManager *photoMgr;
@property (nonatomic, assign) NSInteger total;
@property (nonatomic, assign) AAChartModel *aaChartModel;
@property (nonatomic, strong) AAChartView *aaChartView;
@property (nonatomic, strong) AAChartView *aaChartView;
@property (nonatomic, strong) UILabel * totalLab;
@end
......@@ -27,23 +28,30 @@
[self.navigationController setNavigationBarHidden:NO animated:YES];
self.title = @"图片统计";
[MBProgressHUD showMessage:@"加载中..." delayTime:1.f toView:nil];
// [MBProgressHUD showMessage:@"加载中..." delayTime:1.f toView:nil];
[self setUpTheChartView:AAChartTypePie];
}
- (void)setUpTheChartView:(AAChartType)chartType {
CGRect chartViewFrame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
CGRect chartViewFrame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.width);
self.aaChartView = [[AAChartView alloc]initWithFrame:chartViewFrame];
self.view.backgroundColor = [UIColor whiteColor];
self.aaChartView.scrollEnabled = NO;
[self.view addSubview:self.aaChartView];
_totalLab = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.aaChartView.frame), KScreenWidth, 20)];
_totalLab.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:_totalLab];
self.photoMgr.pauseAction = false;
// if (self.photoMgr.notificationStatus == WKPhotoNotificationStatusNeed) {
if (self.photoMgr.fetchResult == nil) {
[self loadPhotoData: true];
// self.photoMgr.notificationStatus = WKPhotoNotificationStatusDefualt;
// }
}else{
self.total = self.photoMgr.fetchResult.count;
self.aaChartModel = [self configureTheChartModel:nil];
[self.aaChartView aa_drawChartWithChartModel:self.aaChartModel];
}
}
- (WKClearPhotoManager *)photoMgr {
......@@ -55,21 +63,21 @@
- (void)loadPhotoData: (BOOL)isFirstLoad {
[MBProgressHUD showLoading:@"正在查询,请稍后..." toView:self.view];
[MBProgressHUD showLoading:@"正在统计,请稍后..." toView:self.view];
self.photoMgr.currentIndex = 0;
self.photoMgr.pauseAction = false;
[self.photoMgr loadPhotoWithProcess:^(NSInteger current, NSInteger total) {
} completionHandler:^(BOOL success, NSError *error) {
[MBProgressHUD hideHUDForView:self.view];
[self loadLocationAssets];
}];
self.photoMgr.pauseAction = false;
[self.photoMgr loadPhotoWithProcess:^(NSInteger current, NSInteger total) {
} completionHandler:^(BOOL success, NSError *error) {
[MBProgressHUD hideHUDForView:self.view];
[self loadLocationAssets];
}];
}
- (void)loadLocationAssets {
[MBProgressHUD showLoading:@"正在查询,请稍后..." toView:self.view];
[MBProgressHUD showLoading:@"正在统计,请稍后..." toView:self.view];
[self.photoMgr loadLocationPhotoWithProcess:^(NSInteger current, NSInteger total) {
NSLog(@"loadLocationPhotoWithProcess %ld", (long)current);
......@@ -84,14 +92,26 @@
- (AAChartModel *)configureTheChartModel:(NSString *)chartType {
NSInteger f = self.photoMgr.similarLiveArray.count;
NSInteger ff = self.photoMgr.similarArray.count;
NSInteger f = 0;
for (NSArray * subArr in self.photoMgr.similarLiveArray){
f += subArr.count;
}
NSInteger ff = 0;
for (NSArray * subArr in self.photoMgr.similarArray){
ff += subArr.count;
}
NSInteger fff = self.photoMgr.snapshotArray.count;
NSInteger ffff = self.photoMgr.locationArray.count;
NSInteger ffff = 0;
for (NSArray * subArr in self.photoMgr.locationArray){
ffff += subArr.count;
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
self.totalLab.text = [NSString stringWithFormat:@"合计:%ld", (long)self.total];
});
NSInteger fffff = self.total -f -ff-fff-ffff;
AASeriesElement *element = AASeriesElement.new
.nameSet(@"语言热度值")
.nameSet(@"数量")
.innerSizeSet(@"20%")//内部圆环半径大小占比
.sizeSet(@200)//尺寸大小
.borderWidthSet(@0)//描边的宽度
......@@ -101,21 +121,21 @@
.enabledSet(false)//禁用点击区块之后出现的半透明遮罩层
))
.dataSet(@[
@[@"IE", [NSNumber numberWithInteger:f]],
@[@"相似动态图片", [NSNumber numberWithInteger:f]],
@{@"sliced": @true,
@"selected": @true,
@"name": @"Chrome",
@"name": @"相似图片",
@"y": [NSNumber numberWithInteger:ff]},
@[@"Safari", [NSNumber numberWithInteger:fff]],
@[@"Opera", [NSNumber numberWithInteger:ffff]],
@[@"Others", [NSNumber numberWithInteger:fffff]],
@[@"屏幕截图", [NSNumber numberWithInteger:fff]],
@[@"同地点图片", [NSNumber numberWithInteger:ffff]],
@[@"其他", [NSNumber numberWithInteger:fffff]],
]);
return AAChartModel.new
.chartTypeSet(AAChartTypePie)
.colorsThemeSet(@[@"#0c9674",@"#7dffc0",@"#ff3333",@"#facd32",@"#ffffa0",@"#EA007B"])
.dataLabelsEnabledSet(true)//是否直接显示扇形图数据
.yAxisTitleSet(@"摄氏度")
.yAxisTitleSet(@"")
.seriesSet(@[element])
;
}
......
......@@ -48,8 +48,10 @@
if (granted) {
NSArray *events = [[WMEventCalendarTool sharedCalendar] checkToStartDate:[NSDate dateWithTimeIntervalSince1970:1514375207] addEndDate: [NSDate date] addModifytitle:nil addCalendarIdentifier: nil];
self.events = events.mutableCopy;
[self.tableView reloadData];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
[self.tableView layoutIfNeeded];
});
// for (int i = 0; i < events.count; i++) {
// EKEvent *event = events[i];
// NSLog(@"%@ - %@",event.title,event.eventIdentifier);
......@@ -65,9 +67,10 @@
[[WMEventCalendarTool sharedCalendar] checkCalendarReminderCanUsedCompletion:^(BOOL granted, NSError *error) {
if (granted) {
[[WMEventCalendarTool sharedCalendar] checkCompletedRemindersStartDate:[NSDate dateWithTimeIntervalSince1970:1514375207] addEndDate:[NSDate date] fetchCompleted:^(NSArray<EKReminder *> *reminders) {
self.reminders = reminders.mutableCopy;
dispatch_async(dispatch_get_main_queue(), ^{
self.reminders = reminders.mutableCopy;
[self.tableView reloadData];
[self.tableView layoutIfNeeded];
// // EKReminder *event = reminders[i];
// for (EKReminder *reminder in reminders) {
// NSLog(@"提醒事项 - %@ ",reminder.title);
......
......@@ -26,7 +26,7 @@
@property (nonatomic, assign) CGFloat maxValue;
@property (nonatomic, assign) CGFloat currentValue;
@property(nonatomic, strong) STDPingServices *pingServices;
@property(nonatomic, strong) STDPingServices *pingServices;
@property (strong, nonatomic) SCNetWorkDashBoardView * board;
......@@ -86,7 +86,7 @@
- (void)pingActionFired {
self.pingServices = [STDPingServices startPingAddress: @"117.78.49.136" monitorTime: 5 callbackHandler:^(STDPingItem *pingItem, NSArray *pingItems) {
self.pingServices = [STDPingServices startPingAddress: @"https://www.baidu.com" monitorTime: 5 callbackHandler:^(STDPingItem *pingItem, NSArray *pingItems) {
if (pingItem.status != STDPingStatusFinished) {
NSLog(@"-----%@", pingItem.description);
} else {
......@@ -129,12 +129,10 @@
if ([[QBTools formattedFileSize:speed] containsString:@"KB"]) {
networkSpeed = [[QBTools formattedFileSize:speed] floatValue] / 1024;
unit = @"KB";
}
if ([[QBTools formattedFileSize:speed] containsString:@"bytes"]) {
}else if ([[QBTools formattedFileSize:speed] containsString:@"bytes"]) {
networkSpeed = [[QBTools formattedFileSize:speed] floatValue] / 1024 / 1024;
unit = @"bytes";
}
if ([[QBTools formattedFileSize:speed] containsString:@"GB"]) {
}else if ([[QBTools formattedFileSize:speed] containsString:@"GB"]) {
networkSpeed = [[QBTools formattedFileSize:speed] floatValue] * 1024;
unit = @"GB";
} else {
......
//
// QJGIFView.h
// xiaoquguanjia
//
// Created by WuXian on 16/1/18.
// Copyright © 2016年 buybal. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
@interface QJGIFView : UIView{
CGImageSourceRef gif; // 保存gif动画
NSDictionary *gifProperties; // 保存gif动画属性
size_t index;// gif动画播放开始的帧序号
size_t count;// gif动画的总帧数
NSTimer *timer;// 播放gif动画所使用的timer
}
@property (nonatomic,copy) NSData * gifData;
- (id)initWithFrame:(CGRect)frame filePath:(NSString *)_filePath;
- (id)initWithFrame:(CGRect)frame data:(NSData *)_data;
- (void)startWithData:(NSData *)gifData;
- (void)stopGif;
@end
//
// QJGIFView.m
// xiaoquguanjia
//
// Created by WuXian on 16/1/18.
// Copyright © 2016年 buybal. All rights reserved.
//
#import "QJGIFView.h"
#import <QuartzCore/QuartzCore.h>
@implementation QJGIFView
- (id)initWithFrame:(CGRect)frame filePath:(NSString *)_filePath{
self = [super initWithFrame:frame];
if (self) {
gifProperties = [NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:0] forKey:(NSString *)kCGImagePropertyGIFLoopCount]
forKey:(NSString *)kCGImagePropertyGIFDictionary];
gif = CGImageSourceCreateWithURL((CFURLRef)[NSURL fileURLWithPath:_filePath], (CFDictionaryRef)gifProperties);
count =CGImageSourceGetCount(gif);
timer = [NSTimer scheduledTimerWithTimeInterval:0.12 target:self selector:@selector(play) userInfo:nil repeats:YES];
[timer fire];
}
return self;
}
- (id)initWithFrame:(CGRect)frame data:(NSData *)_data{
self = [super initWithFrame:frame];
if (self) {
gifProperties = [NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:0] forKey:(NSString *)kCGImagePropertyGIFLoopCount]
forKey:(NSString *)kCGImagePropertyGIFDictionary];
// gif = CGImageSourceCreateWithURL((CFURLRef)[NSURL fileURLWithPath:_filePath], (CFDictionaryRef)gifProperties);
gif = CGImageSourceCreateWithData((CFDataRef)_data, (CFDictionaryRef)gifProperties);
count =CGImageSourceGetCount(gif);
timer = [NSTimer scheduledTimerWithTimeInterval:0.12 target:self selector:@selector(play) userInfo:nil repeats:YES];
[timer fire];
}
return self;
}
- (void)startWithData:(NSData *)gifData
{
if (gifData == nil) {
gifData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"jumafu_loading.gif" ofType:nil]];
}
gifProperties = [NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:0] forKey:(NSString *)kCGImagePropertyGIFLoopCount]
forKey:(NSString *)kCGImagePropertyGIFDictionary];
gif = CGImageSourceCreateWithData((CFDataRef)gifData, (CFDictionaryRef)gifProperties);
count =CGImageSourceGetCount(gif);
timer = [NSTimer scheduledTimerWithTimeInterval:0.12 target:self selector:@selector(play) userInfo:nil repeats:YES];
[timer fire];
}
-(void)play
{
index ++;
index = index%count;
CGImageRef ref = CGImageSourceCreateImageAtIndex(gif, index, (CFDictionaryRef)gifProperties);
self.layer.contents = (__bridge id)ref;
CFRelease(ref);
}
-(void)removeFromSuperview
{
NSLog(@"removeFromSuperview");
[timer invalidate];
timer = nil;
[super removeFromSuperview];
}
- (void)dealloc {
NSLog(@"dealloc");
CFRelease(gif);
}
- (void)stopGif
{
[timer invalidate];
timer = nil;
}
- (NSData *)loadDataForType:(NSInteger)type {
NSData *data = nil;
if (type == 0) {
//网络
data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://s14.sinaimg.cn/mw690/005APVsyzy6MFOsVFfv5d&690"]];
}else {
//本地
data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"run" ofType:@"gif"]];
}
return data;
}
@end
......@@ -7,8 +7,6 @@
//
#define start1 -0.33
//#define urlString @"http://cdn2.ime.sogou.com/4ecd0732b804944f2939ac4aeaff5198/5f2270d9/dl/index/1588947491/sogou_mac_58a.zip"//3M
//#define urlString @"https://ucan.25pp.com/PPAssistant_PP_103.apk"//3M
#import "MeasurNetTools.h"
@interface MeasurNetTools ()
......@@ -67,18 +65,14 @@
-(void)meausurNet
{
NSArray *urlArray = @[@"https://wap.pp.cn/app/dl/fs08/2020/07/29/9/106_d25a9ecceb45514ad2583bb440740704.apk",
@"https://wap.pp.cn/app/dl/fs08/2020/07/15/7/110_b4a157dc5f4aaaedc9351a4acc72d967.apk",
@"https://wap.pp.cn/app/dl/fs08/2020/07/23/4/1_fd63e3d0d7161c0671e385b8ac7d5967.apk",
@"https://ucan.25pp.com/PPAssistant_PP_103.apk",
@"https://wap.pp.cn/app/dl/fs08/2020/07/28/9/123_88a8613b9cdacc254f028e9041339de2.apk"];
NSArray *urlArray = @[@"http://speedtest1.tj.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest1.tj.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest1.he.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest.bmcc.com.cn:8080/speedtest/random4000x4000.jpg", @"http://bj3.unicomtest.com:8080/speedtest/random4000x4000.jpg"];
int value = arc4random() % urlArray.count;
NSString *urlString = urlArray[value];
_timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(countTime) userInfo:nil repeats:YES];
NSURL *url = [NSURL URLWithString:urlString];
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
_connect = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
......@@ -120,8 +114,6 @@
_connect = nil;
}
#pragma mark - urlconnect delegate methods
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
if (self.faildBlock) {
......@@ -137,7 +129,17 @@
- (void)connectionDidFinishLoading:(NSURLConnection *)connection{
NSLog(@"connectionDidFinishLoading");
[self finishMeasure];
// [self finishMeasure];
NSArray *urlArray = @[@"http://speedtest1.tj.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest1.tj.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest1.he.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest.bmcc.com.cn:8080/speedtest/random4000x4000.jpg", @"http://bj3.unicomtest.com:8080/speedtest/random4000x4000.jpg"];
int value = arc4random() % urlArray.count;
NSString *urlString = urlArray[value];
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
}
......
......@@ -66,19 +66,19 @@
#define ICLocalized(name) [NSString stringWithFormat:@"%@",NSLocalizedString(name, nil)]
// 正常打印(包括方法名和代码所在的行数)
#ifdef DEBUG
#define ServerReport @"http://reporttest.zhangxinhulian.com"
#define ServerHost @"https://feedapitest.zhangxinhulian.com" // 服务端接口地址
#define NSLog(format, ...) printf("\n[%s] %s [%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
//#ifdef DEBUG
//
//#define ServerReport @"http://reporttest.zhangxinhulian.com"
//#define ServerHost @"https://feedapitest.zhangxinhulian.com" // 服务端接口地址
//
//#define NSLog(format, ...) printf("\n[%s] %s [%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
//#else
#define ServerReport @"http://report.zhangxinhulian.com"
#define ServerHost @"https://feedapi.zhangxinhulian.com"
#define NSLog(format, ...) nil
#endif
//#define NSLog(format, ...) nil
//#endif
typedef enum: NSUInteger {
SimilayNormalPhoto = 0,
......
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