Commit ea238559 authored by CZ1004's avatar CZ1004

Merge branch 'Advertisement' of…

Merge branch 'Advertisement' of http://gitlab.zhangxindiet.com/ShuMing/phonemanager into Advertisement

* 'Advertisement' of http://gitlab.zhangxindiet.com/ShuMing/phonemanager:
  fix bugs
  取消删除照片动画立即小时处理
  1.删除加载动画 2.启动页面重制完成 3.UI适配修复 4.通知功能完善
parents 0dbf1f97 5f11fba4
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "huadong@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "huadong@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "lunbo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "lunbo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "lunbo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "lunbo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tongjitu@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tongjitu@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "lunbo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "lunbo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "shuye@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "shuye@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "zhaopian@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon_fanhui@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon_fanhui@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -303,10 +303,13 @@ class CompressCompletedViewController : BaseViewController{ ...@@ -303,10 +303,13 @@ class CompressCompletedViewController : BaseViewController{
let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: idents, options: nil) let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: idents, options: nil)
let fileSize = FileTool().calculateTotalAssetSize(fetchResult: fetchResult) let fileSize = FileTool().calculateTotalAssetSize(fetchResult: fetchResult)
let assetToDelete = fetchResult.firstObject let assetToDelete = fetchResult.firstObject
PMLoadingHUD.share.show()
PHPhotoLibrary.shared().performChanges ({ PHPhotoLibrary.shared().performChanges ({
PHAssetChangeRequest.deleteAssets([assetToDelete] as NSFastEnumeration) PHAssetChangeRequest.deleteAssets([assetToDelete] as NSFastEnumeration)
}){ success, error in }){ success, error in
if(success){ if(success){
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
PMLoadingHUD.share.disMiss()
var models :[AssetModel] = [] var models :[AssetModel] = []
var count = 0 var count = 0
for ele in self.model! { for ele in self.model! {
...@@ -319,7 +322,9 @@ class CompressCompletedViewController : BaseViewController{ ...@@ -319,7 +322,9 @@ class CompressCompletedViewController : BaseViewController{
print("删除文件成功") print("删除文件成功")
self.showDeleteSuccess(fileCount:count, fileSize: fileSize) self.showDeleteSuccess(fileCount:count, fileSize: fileSize)
self.jumpToCompressVC() self.jumpToCompressVC()
}
}else { }else {
PMLoadingHUD.share.disMiss()
if let error = error { if let error = error {
print("删除文件时出错: \(error.localizedDescription)") print("删除文件时出错: \(error.localizedDescription)")
} }
......
...@@ -64,9 +64,14 @@ class HomeInfoViewController:BaseViewController { ...@@ -64,9 +64,14 @@ class HomeInfoViewController:BaseViewController {
} }
let fetchs = PHAsset.fetchAssets(withLocalIdentifiers: tempStringArray, options: nil) let fetchs = PHAsset.fetchAssets(withLocalIdentifiers: tempStringArray, options: nil)
let fileSize = FileTool().calculateTotalAssetSize(fetchResult: fetchs) let fileSize = FileTool().calculateTotalAssetSize(fetchResult: fetchs)
//
PhotoAndVideoMananger.deleteAssets(localIdentifiers: tempStringArray) {[weak self] in PhotoAndVideoMananger.deleteAssets(localIdentifiers: tempStringArray) {[weak self] in
guard let self else {return} guard let self else {return}
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
PMLoadingHUD.share.disMiss()
// 更新免费次数 // 更新免费次数
if isAfterAdv == false { if isAfterAdv == false {
updateFreeTimes() updateFreeTimes()
...@@ -97,6 +102,9 @@ class HomeInfoViewController:BaseViewController { ...@@ -97,6 +102,9 @@ class HomeInfoViewController:BaseViewController {
self?.tablewView.deleteModel(array: imgs) self?.tablewView.deleteModel(array: imgs)
} }
}) })
}
// 更新下首页数据以及缓存数据 // 更新下首页数据以及缓存数据
let dataUpdated = Notification.Name("DataUpdatedNotification") let dataUpdated = Notification.Name("DataUpdatedNotification")
NotificationCenter.default.post(name: dataUpdated, object: nil, userInfo: nil) NotificationCenter.default.post(name: dataUpdated, object: nil, userInfo: nil)
......
...@@ -557,21 +557,30 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti ...@@ -557,21 +557,30 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
let allIdent = self.selectedModel.map{ $0.localIdentifier } let allIdent = self.selectedModel.map{ $0.localIdentifier }
let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: allIdent, options: nil) let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: allIdent, options: nil)
let fileSize = FileTool().calculateTotalAssetSize(fetchResult: fetchResult) let fileSize = FileTool().calculateTotalAssetSize(fetchResult: fetchResult)
PMLoadingHUD.share.show()
PHPhotoLibrary.shared().performChanges ({ PHPhotoLibrary.shared().performChanges ({
PHAssetChangeRequest.deleteAssets(fetchResult as NSFastEnumeration) PHAssetChangeRequest.deleteAssets(fetchResult as NSFastEnumeration)
}){ success, error in }){ success, error in
if(success){ if(success){
print("删除文件成功") print("删除文件成功")
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
PMLoadingHUD.share.disMiss()
if isAfterAdv == false { if isAfterAdv == false {
self.updateFreeTimes() self.updateFreeTimes()
} }
self.showDeleteSuccess(fileCount: allIdent.count, fileSize: fileSize) self.showDeleteSuccess(fileCount: allIdent.count, fileSize: fileSize)
self.updateCurrentPageWhenDeleteAny() self.updateCurrentPageWhenDeleteAny()
}
}else { }else {
PMLoadingHUD.share.disMiss()
if let error = error { if let error = error {
print("删除文件时出错: \(error.localizedDescription)") print("删除文件时出错: \(error.localizedDescription)")
} }
} }
} }
} }
......
...@@ -473,10 +473,13 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie ...@@ -473,10 +473,13 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
// 删除当前选择 // 删除当前选择
let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: self.selectedModel.map{$0.localIdentifier}, options: nil) let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: self.selectedModel.map{$0.localIdentifier}, options: nil)
let fileSize = FileTool().calculateTotalAssetSize(fetchResult: fetchResult) let fileSize = FileTool().calculateTotalAssetSize(fetchResult: fetchResult)
PMLoadingHUD.share.show()
PHPhotoLibrary.shared().performChanges ({ PHPhotoLibrary.shared().performChanges ({
PHAssetChangeRequest.deleteAssets(fetchResult as NSFastEnumeration) PHAssetChangeRequest.deleteAssets(fetchResult as NSFastEnumeration)
}){ success, error in }){ success, error in
if(success){ if(success){
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
PMLoadingHUD.share.disMiss()
print("删除文件成功") print("删除文件成功")
// 如果是看广告删除的,且还有免费次数 // 如果是看广告删除的,且还有免费次数
if isAfterAdv == false { if isAfterAdv == false {
...@@ -486,12 +489,13 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie ...@@ -486,12 +489,13 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
self.showDeleteSuccess(fileCount: self.selectedModel.count, fileSize: fileSize) self.showDeleteSuccess(fileCount: self.selectedModel.count, fileSize: fileSize)
// 移除当前总数据源的数据 // 移除当前总数据源的数据
self.updateCurrentPageWhenDeleteAny() self.updateCurrentPageWhenDeleteAny()
}
}else { }else {
PMLoadingHUD.share.disMiss()
if let error = error { if let error = error {
print("删除文件时出错: \(error.localizedDescription)") print("删除文件时出错: \(error.localizedDescription)")
} }
} }
} }
} }
......
...@@ -70,7 +70,7 @@ class LandingVC:UIViewController { ...@@ -70,7 +70,7 @@ class LandingVC:UIViewController {
}else { }else {
changeCurrentIndex(index: nextIndex) // changeCurrentIndex(index: nextIndex)
} }
} }
......
//
// NewGuideViewController.swift
// PhoneManager
//
// Created by edy on 2025/4/28.
//
import UIKit
class NewGuideViewController: UIViewController {
@IBOutlet weak var privacyL: UILabel!
@IBOutlet weak var dotImage: UIImageView!
@IBOutlet weak var collectionView: UICollectionView!
var timer: Timer?
@IBOutlet weak var startBtn: UIButton!
@IBOutlet weak var termsL: UILabel!
let dots = ["icon_guide_one","icon_guide_two","icon_guide_three"]
var index = 0
override func viewDidLoad() {
super.viewDidLoad()
configUI()
startTimer()
}
func configUI(){
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal
layout.minimumLineSpacing = 0
layout.minimumInteritemSpacing = 0
collectionView.setCollectionViewLayout(layout, animated: false)
collectionView.delegate = self
collectionView.dataSource = self
collectionView.isScrollEnabled = false
collectionView.backgroundColor = .white
collectionView.isPagingEnabled = true // 启用分页
collectionView.showsHorizontalScrollIndicator = false
collectionView.register(UINib.init(nibName: "NewGuideOneCell", bundle: nil), forCellWithReuseIdentifier: "NewGuideOneCell")
collectionView.register(UINib.init(nibName: "NewGuideTwoCell", bundle: nil), forCellWithReuseIdentifier: "NewGuideTwoCell")
collectionView.register(UINib.init(nibName: "NewGuideThreeCell", bundle: nil), forCellWithReuseIdentifier: "NewGuideThreeCell")
privacyL.addUnderline()
termsL.addUnderline()
let onetap = UITapGestureRecognizer(target: self, action: #selector(pricyClick))
privacyL.isUserInteractionEnabled = true
privacyL.addGestureRecognizer(onetap)
let twotap = UITapGestureRecognizer(target: self, action: #selector(termClick))
termsL.isUserInteractionEnabled = true
termsL.addGestureRecognizer(twotap)
}
@IBAction func nextClick(_ sender: Any) {
if index < 2{
index += 1
collectionView.scrollToItem(at: IndexPath(row: index, section: 0), at: .centeredHorizontally, animated: true)
}else{
enterHome()
}
dotImage.image = UIImage.init(named: dots[index])
}
@objc func pricyClick(){
let vc:PrivacyPolicyWebViewController = PrivacyPolicyWebViewController()
vc.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(vc, animated: true)
}
@objc func termClick(){
let vc:TermOfUseWebViewController = TermOfUseWebViewController()
vc.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(vc, animated: true)
}
func enterHome(){
let vc:HomeViewController = HomeViewController()
let nav = BaseNavViewController(rootViewController: vc)
cWindow?.rootViewController = nav
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
// 添加动画到 window 的 layer
cWindow?.layer.add(transition, forKey: kCATransition)
// 显示 window
cWindow?.makeKeyAndVisible()
UserDef.shard.isShowLanding = true
UserDef.shard.saveUserDefToSandBox()
}
deinit{
timer?.invalidate()
}
func startTimer() {
// 创建定时器,每隔 3 秒调用一次
// timer = Timer.scheduledTimer(timeInterval: 3.5, target: self, selector: #selector(advanceToNextItem), userInfo: nil, repeats: true)
}
@objc func advanceToNextItem() {
if index < 2{
index += 1
collectionView.scrollToItem(at: IndexPath(row: index, section: 0), at: .centeredHorizontally, animated: true)
}else{
timer?.invalidate()
}
dotImage.image = UIImage.init(named: dots[index])
}
}
extension NewGuideViewController:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return dots.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if indexPath.row == 0{
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "NewGuideOneCell", for: indexPath) as! NewGuideOneCell
return cell
}
if indexPath.row == 1{
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "NewGuideTwoCell", for: indexPath) as! NewGuideTwoCell
return cell
}
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "NewGuideThreeCell", for: indexPath) as! NewGuideThreeCell
return cell
}
// MARK: - UICollectionViewDelegateFlowLayout
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return collectionView.bounds.size // 让单元格大小与 UICollectionView 的大小一致
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="NewGuideViewController" customModule="PhoneManager" customModuleProvider="target">
<connections>
<outlet property="collectionView" destination="aWw-dt-Ug8" id="HUc-Ay-CMz"/>
<outlet property="dotImage" destination="fFL-WW-PLN" id="bqc-fa-6q6"/>
<outlet property="privacyL" destination="YTE-mC-XiJ" id="dTv-J9-Mb1"/>
<outlet property="startBtn" destination="Eed-Dx-A2f" id="8Fc-Km-gcW"/>
<outlet property="termsL" destination="MTA-lV-gmK" id="tDQ-qr-bnt"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="aWw-dt-Ug8">
<rect key="frame" x="0.0" y="59" width="393" height="647"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="10" minimumInteritemSpacing="10" id="NJe-Nq-4b2">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
</collectionView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Eed-Dx-A2f">
<rect key="frame" x="16" y="740" width="361" height="48"/>
<color key="backgroundColor" red="0.0" green="0.50980392159999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="hv3-F2-dqD"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Get started"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="Radius">
<real key="value" value="24"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="nextClick:" destination="-1" eventType="touchUpInside" id="GRf-fM-m1C"/>
</connections>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_next_white" translatesAutoresizingMaskIntoConstraints="NO" id="9Xi-Sn-dy7">
<rect key="frame" x="337" y="754" width="20" height="20"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_guide_one" translatesAutoresizingMaskIntoConstraints="NO" id="fFL-WW-PLN">
<rect key="frame" x="177.66666666666666" y="716" width="38" height="6"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="and" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PYH-l3-Gys">
<rect key="frame" x="184.33333333333334" y="800" width="24.333333333333343" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.50196078431372548" green="0.50196078431372548" blue="0.50196078431372548" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Privacy Policy" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YTE-mC-XiJ">
<rect key="frame" x="91.333333333333314" y="800" width="90" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.50196078430000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MTA-lV-gmK">
<rect key="frame" x="211.66666666666666" y="800" width="85.666666666666657" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.50196078430000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="MTA-lV-gmK" firstAttribute="leading" secondItem="PYH-l3-Gys" secondAttribute="trailing" constant="3" id="0BZ-zy-aTT"/>
<constraint firstItem="PYH-l3-Gys" firstAttribute="centerX" secondItem="Eed-Dx-A2f" secondAttribute="centerX" id="2vR-cn-YEa"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="aWw-dt-Ug8" secondAttribute="trailing" id="9Cc-oc-OnJ"/>
<constraint firstItem="PYH-l3-Gys" firstAttribute="top" secondItem="Eed-Dx-A2f" secondAttribute="bottom" constant="12" id="AcP-Xd-wVP" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="aWw-dt-Ug8" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="CKc-pK-IbP"/>
<constraint firstItem="MTA-lV-gmK" firstAttribute="centerY" secondItem="YTE-mC-XiJ" secondAttribute="centerY" id="EZU-YS-gg9"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Eed-Dx-A2f" secondAttribute="trailing" constant="16" id="LPg-h1-1jp"/>
<constraint firstItem="PYH-l3-Gys" firstAttribute="leading" secondItem="YTE-mC-XiJ" secondAttribute="trailing" constant="3" id="T9s-gT-2Nc"/>
<constraint firstItem="aWw-dt-Ug8" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="f0o-86-Nyw"/>
<constraint firstItem="Eed-Dx-A2f" firstAttribute="top" secondItem="fFL-WW-PLN" secondAttribute="bottom" constant="18" id="gQt-CN-EO1"/>
<constraint firstItem="Eed-Dx-A2f" firstAttribute="centerX" secondItem="fFL-WW-PLN" secondAttribute="centerX" id="hLi-H1-Hh6"/>
<constraint firstItem="PYH-l3-Gys" firstAttribute="centerY" secondItem="YTE-mC-XiJ" secondAttribute="centerY" id="lii-mZ-sDU"/>
<constraint firstItem="Eed-Dx-A2f" firstAttribute="centerY" secondItem="9Xi-Sn-dy7" secondAttribute="centerY" id="m8o-7F-nVo"/>
<constraint firstItem="Eed-Dx-A2f" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="16" id="vnG-zF-AnX"/>
<constraint firstItem="9Xi-Sn-dy7" firstAttribute="trailing" secondItem="Eed-Dx-A2f" secondAttribute="trailing" constant="-20" id="wE5-UJ-vND"/>
<constraint firstItem="fFL-WW-PLN" firstAttribute="top" secondItem="aWw-dt-Ug8" secondAttribute="bottom" constant="10" id="wtu-CZ-FSb"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Eed-Dx-A2f" secondAttribute="bottom" constant="30" id="yzP-S5-Y8c"/>
</constraints>
<point key="canvasLocation" x="15" y="20"/>
</view>
</objects>
<resources>
<image name="icon_guide_one" width="38" height="6"/>
<image name="icon_next_white" width="20" height="20"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
...@@ -22,6 +22,8 @@ class PermissionVC:UIViewController { ...@@ -22,6 +22,8 @@ class PermissionVC:UIViewController {
private var isTOUClick:Bool = false private var isTOUClick:Bool = false
private var isNextClick:Bool = false
lazy var animationView:LottieAnimationView = { lazy var animationView:LottieAnimationView = {
let animationView = LottieAnimationView(name: "onboardingStorageLight") let animationView = LottieAnimationView(name: "onboardingStorageLight")
...@@ -170,19 +172,19 @@ class PermissionVC:UIViewController { ...@@ -170,19 +172,19 @@ class PermissionVC:UIViewController {
private func gotoNext() { private func gotoNext() {
DispatchQueue.main.async {[weak self] in guard isNextClick == false else{
return
guard let self else {return} }
let Ssoryboard = UIStoryboard(name: "LandingVC", bundle: nil)
if let current = Ssoryboard.instantiateViewController(identifier: "LandingVCID") as? LandingVC { isNextClick = true
self.navigationController?.pushViewController(current, animated: true) DispatchQueue.main.async {[weak self] in
guard let self else {return}
let vc = NewGuideViewController()
self.navigationController?.pushViewController(vc, animated: true)
} }
} }
}
private func ppClick() { private func ppClick() {
......
//
// NewGuideOneCell.swift
// PhoneManager
//
// Created by edy on 2025/4/28.
//
import UIKit
class NewGuideOneCell: UICollectionViewCell {
@IBOutlet weak var subtitle: UILabel!
@IBOutlet weak var htitle: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
setSubtitleAttr()
sethtitleAttr()
}
func setSubtitleAttr(){
// 创建富文本
let fullText = "Over 1000+ users worldwide"
// 创建可变的富文本字符串
let attributedString = NSMutableAttributedString(string: fullText)
// 定义 "1000+" 的范围
let range = (fullText as NSString).range(of: "1000+")
// 设置其他部分的属性(字体颜色为黑色,Regular 字体)
attributedString.addAttribute(.foregroundColor, value: UIColor.colorWithHex(hexStr: "#151515"), range: NSRange(location: 0, length: fullText.count))
attributedString.addAttribute(.font, value: UIFont.systemFont(ofSize: 24), range: NSRange(location: 0, length: fullText.count))
// 设置 "1000+" 的属性(字体颜色为蓝色,字体加粗)
attributedString.addAttribute(.foregroundColor, value: UIColor.colorWithHex(hexStr: "#0183FF"), range: range)
attributedString.addAttribute(.font, value: UIFont.boldSystemFont(ofSize: 24), range: range)
// 将属性字符串设置为 UILabel 的文本
subtitle.attributedText = attributedString
}
func sethtitleAttr(){
// 创建富文本
let fullText = "Selected 'Phone manager'"
// 创建可变的富文本字符串
let attributedString = NSMutableAttributedString(string: fullText)
let range = (fullText as NSString).range(of: "'Phone manager'")
attributedString.addAttribute(.foregroundColor, value: UIColor.colorWithHex(hexStr: "#262626"), range: NSRange(location: 0, length: fullText.count))
attributedString.addAttribute(.foregroundColor, value: UIColor.colorWithHex(hexStr: "#0183FF"), range: range)
// 将属性字符串设置为 UILabel 的文本
htitle.attributedText = attributedString
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.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"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="NewGuideOneCell" customModule="PhoneManager" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="383" height="642"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="383" height="642"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Welcome to use" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9sQ-uI-GSY">
<rect key="frame" x="101.66666666666669" y="36" width="180" height="30"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="25"/>
<color key="textColor" red="0.082352941176470587" green="0.082352941176470587" blue="0.082352941176470587" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Phone Manager" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EVM-dM-Bi7">
<rect key="frame" x="77.666666666666686" y="67" width="228" height="39"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="32"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Over 1000+ users worldwide" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Txd-ub-V2M">
<rect key="frame" x="42.666666666666657" y="166" width="298" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Selected 'Phone manager'" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ofu-Vm-8RJ">
<rect key="frame" x="81" y="203" width="221" height="21.666666666666657"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_guide_ye" translatesAutoresizingMaskIntoConstraints="NO" id="qJm-ym-n7r">
<rect key="frame" x="27" y="312.66666666666669" width="159" height="45"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dp0-fO-xVX">
<rect key="frame" x="191" y="330.33333333333331" width="1" height="10"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="10" id="iOh-nB-kgO"/>
<constraint firstAttribute="width" constant="1" id="iWR-5H-gSD"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_guide_ye" translatesAutoresizingMaskIntoConstraints="NO" id="tPc-eM-ini">
<rect key="frame" x="197" y="312.66666666666669" width="159" height="45"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="50,000+" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Gkr-xl-yIC">
<rect key="frame" x="231" y="316.66666666666669" width="91" height="27"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Clean up photos" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BBI-So-OYY">
<rect key="frame" x="232.66666666666666" y="343.66666666666669" width="87.666666666666657" height="13.333333333333314"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="11"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1,000+" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="btU-j2-5y8">
<rect key="frame" x="69.666666666666671" y="316.66666666666669" width="74.000000000000014" height="27"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="User" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Nyn-Jp-1go">
<rect key="frame" x="94" y="343.66666666666669" width="25.333333333333329" height="13.333333333333314"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="11"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_guide_huadong" translatesAutoresizingMaskIntoConstraints="NO" id="dtg-ck-CGz">
<rect key="frame" x="8" y="392.66666666666669" width="375" height="144.00000000000006"/>
<constraints>
<constraint firstAttribute="height" constant="144" id="7cs-70-ugl" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="width" constant="375" id="WrQ-JG-AK0" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
</constraints>
</imageView>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="9sQ-uI-GSY" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="36" id="Dq4-aV-exs"/>
<constraint firstItem="BBI-So-OYY" firstAttribute="top" secondItem="Gkr-xl-yIC" secondAttribute="bottom" id="I6f-NQ-WJu"/>
<constraint firstItem="EVM-dM-Bi7" firstAttribute="top" secondItem="9sQ-uI-GSY" secondAttribute="bottom" constant="1" id="JLS-5B-Kda"/>
<constraint firstItem="tPc-eM-ini" firstAttribute="leading" secondItem="Dp0-fO-xVX" secondAttribute="trailing" constant="5" id="NfG-Bx-1Vg"/>
<constraint firstItem="Ofu-Vm-8RJ" firstAttribute="centerX" secondItem="Txd-ub-V2M" secondAttribute="centerX" id="Q0j-xo-CHV"/>
<constraint firstItem="btU-j2-5y8" firstAttribute="centerX" secondItem="qJm-ym-n7r" secondAttribute="centerX" id="S86-FY-F3L"/>
<constraint firstAttribute="trailing" secondItem="dtg-ck-CGz" secondAttribute="trailing" id="SpU-Oy-b4U"/>
<constraint firstItem="tPc-eM-ini" firstAttribute="centerY" secondItem="qJm-ym-n7r" secondAttribute="centerY" id="Ukb-ZR-W1X"/>
<constraint firstItem="Dp0-fO-xVX" firstAttribute="leading" secondItem="qJm-ym-n7r" secondAttribute="trailing" constant="5" id="WHf-ED-G3K"/>
<constraint firstItem="9sQ-uI-GSY" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="XNB-Il-ZRE"/>
<constraint firstItem="EVM-dM-Bi7" firstAttribute="centerX" secondItem="9sQ-uI-GSY" secondAttribute="centerX" id="bqK-Xz-cHO"/>
<constraint firstItem="Nyn-Jp-1go" firstAttribute="top" secondItem="btU-j2-5y8" secondAttribute="bottom" id="bsR-mv-bgo"/>
<constraint firstItem="Gkr-xl-yIC" firstAttribute="centerX" secondItem="tPc-eM-ini" secondAttribute="centerX" id="epC-tH-STr"/>
<constraint firstItem="Dp0-fO-xVX" firstAttribute="centerY" secondItem="qJm-ym-n7r" secondAttribute="centerY" id="ex1-1Y-vor"/>
<constraint firstItem="BBI-So-OYY" firstAttribute="centerX" secondItem="tPc-eM-ini" secondAttribute="centerX" id="hCJ-Q6-VDe"/>
<constraint firstItem="Txd-ub-V2M" firstAttribute="centerX" secondItem="EVM-dM-Bi7" secondAttribute="centerX" id="hG2-fs-b8q"/>
<constraint firstItem="BBI-So-OYY" firstAttribute="centerX" secondItem="Gkr-xl-yIC" secondAttribute="centerX" id="hpQ-5U-PBq"/>
<constraint firstItem="Ofu-Vm-8RJ" firstAttribute="top" secondItem="Txd-ub-V2M" secondAttribute="bottom" constant="8" id="n7i-Ki-OaQ"/>
<constraint firstItem="Txd-ub-V2M" firstAttribute="top" secondItem="EVM-dM-Bi7" secondAttribute="bottom" constant="60" id="pa0-0g-Sk0" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="btU-j2-5y8" firstAttribute="top" secondItem="qJm-ym-n7r" secondAttribute="top" constant="4" id="snF-F2-byq"/>
<constraint firstItem="qJm-ym-n7r" firstAttribute="top" secondItem="Ofu-Vm-8RJ" secondAttribute="bottom" constant="88" id="uyA-mj-8K2" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="Dp0-fO-xVX" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="vn8-co-5In"/>
<constraint firstItem="dtg-ck-CGz" firstAttribute="top" secondItem="qJm-ym-n7r" secondAttribute="bottom" constant="35" id="wzG-NF-EWD"/>
<constraint firstItem="Nyn-Jp-1go" firstAttribute="centerX" secondItem="btU-j2-5y8" secondAttribute="centerX" id="y6x-9h-nNx"/>
<constraint firstItem="Gkr-xl-yIC" firstAttribute="top" secondItem="tPc-eM-ini" secondAttribute="top" constant="4" id="ynQ-0m-XQB"/>
</constraints>
<size key="customSize" width="358" height="642"/>
<connections>
<outlet property="htitle" destination="Ofu-Vm-8RJ" id="YM4-rh-Ra7"/>
<outlet property="subtitle" destination="Txd-ub-V2M" id="gKq-qF-heh"/>
</connections>
<point key="canvasLocation" x="370.2290076335878" y="228.16901408450704"/>
</collectionViewCell>
</objects>
<resources>
<image name="icon_guide_huadong" width="375" height="144"/>
<image name="icon_guide_ye" width="159" height="45"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// NewGuideThreeCell.swift
// PhoneManager
//
// Created by edy on 2025/4/28.
//
import UIKit
class NewGuideThreeCell: UICollectionViewCell {
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<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"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="NewGuideThreeCell" customModule="PhoneManager" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="678"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="414" height="678"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_guide_tongjitu" translatesAutoresizingMaskIntoConstraints="NO" id="vPU-c0-KKP">
<rect key="frame" x="85" y="316" width="244" height="239"/>
<constraints>
<constraint firstAttribute="height" constant="239" id="4zt-cu-Hqj" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="width" constant="244" id="gAB-82-r6I" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Experience higher accuracy and professionalism" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZvL-Z4-1T4">
<rect key="frame" x="41.666666666666657" y="47" width="331" height="60"/>
<constraints>
<constraint firstAttribute="width" constant="331" id="Mal-f3-hVk"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="25"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1.56X" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N0R-LM-a3O">
<rect key="frame" x="142.66666666666666" y="157" width="128.99999999999997" height="59"/>
<constraints>
<constraint firstAttribute="height" constant="59" id="A7Z-VL-TvL"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="48"/>
<color key="textColor" red="0.0" green="0.50980392159999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Industry average" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HR3-Fr-izE">
<rect key="frame" x="96" y="216" width="222" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="pQw-Xg-8E2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="31"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="HR3-Fr-izE" firstAttribute="top" secondItem="N0R-LM-a3O" secondAttribute="bottom" id="6eV-Ep-auM"/>
<constraint firstItem="ZvL-Z4-1T4" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="8X2-pX-F3n"/>
<constraint firstItem="vPU-c0-KKP" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="HLK-ZG-TjB"/>
<constraint firstItem="vPU-c0-KKP" firstAttribute="top" secondItem="HR3-Fr-izE" secondAttribute="bottom" constant="57" id="HPy-W3-HcW"/>
<constraint firstItem="N0R-LM-a3O" firstAttribute="top" secondItem="ZvL-Z4-1T4" secondAttribute="bottom" constant="50" id="IRN-zP-UZ0"/>
<constraint firstItem="HR3-Fr-izE" firstAttribute="centerX" secondItem="N0R-LM-a3O" secondAttribute="centerX" id="O9d-fI-MXB"/>
<constraint firstItem="N0R-LM-a3O" firstAttribute="centerX" secondItem="ZvL-Z4-1T4" secondAttribute="centerX" id="qXa-FX-3CI"/>
<constraint firstItem="ZvL-Z4-1T4" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="47" id="zT2-fE-W1k"/>
</constraints>
<size key="customSize" width="414" height="678"/>
<point key="canvasLocation" x="62.595419847328245" y="241.5492957746479"/>
</collectionViewCell>
</objects>
<resources>
<image name="icon_guide_tongjitu" width="244" height="239"/>
</resources>
</document>
//
// NewGuideTwoCell.swift
// PhoneManager
//
// Created by edy on 2025/4/28.
//
import UIKit
import Lottie
class NewGuideTwoCell: UICollectionViewCell {
@IBOutlet weak var photoL: UILabel!
var sizeL:UILabel!
override func awakeFromNib() {
super.awakeFromNib()
contentView.addSubview(animationView)
animationView.snp.makeConstraints { make in
make.width.equalTo(270)
make.height.equalTo(27)
make.centerX.equalToSuperview()
make.top.equalTo(photoL.snp.bottom).offset(10)
}
sizeL = UILabel()
let sizeValue = FileTool().formatBytes(FileTool().getStorageInfo(for: .used) ?? 0 )
sizeL.text = "\(sizeValue) used"
sizeL.textColor = UIColor.colorWithHex(hexStr: "#151515")
sizeL.font = UIFont.systemFont(ofSize: 18, weight: .medium)
contentView.addSubview(sizeL)
sizeL.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(animationView.snp.bottom).offset(5)
}
playAnimationWithDelay()
}
lazy var animationView:LottieAnimationView = {
let animationView = LottieAnimationView(name: "onboardingStorageLight")
animationView.animationSpeed = -1.0
animationView.layer.cornerRadius = 14
animationView.contentMode = .scaleAspectFill
animationView.clipsToBounds = true
return animationView
}()
func playAnimationWithDelay() {
// 播放动画
animationView.play(fromProgress: 0.4, toProgress: 1, loopMode: .playOnce) {[weak self] finished in
if finished {
// 动画播放完成后,延迟 2 秒再重新播放
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
self?.playAnimationWithDelay()
}
}
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.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"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="NewGuideTwoCell" customModule="PhoneManager" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="406" height="731"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="406" height="731"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Clean up duplicate photos" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Jj-wZ-k87">
<rect key="frame" x="55.666666666666657" y="36" width="295" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="295" id="v4m-B6-ilv"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="25"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Immediately delete all duplicate items and keep the original version" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zTf-gE-tij">
<rect key="frame" x="64.666666666666686" y="72" width="277" height="38.333333333333343"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_photos_start" translatesAutoresizingMaskIntoConstraints="NO" id="qBA-8s-5RH">
<rect key="frame" x="118.33333333333334" y="455.33333333333331" width="64.333333333333343" height="63.999999999999943"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rde-nD-tAd">
<rect key="frame" x="202.66666666666666" y="482.33333333333331" width="1" height="10"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="VXQ-Eg-xCw"/>
<constraint firstAttribute="height" constant="10" id="e5o-d7-eTQ"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Photos" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FB0-xV-7Fl">
<rect key="frame" x="126.33333333333331" y="526.33333333333337" width="48" height="17"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="iCloud" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8t2-8U-jr2">
<rect key="frame" x="233.66666666666666" y="526.33333333333337" width="43.999999999999972" height="17"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
<color key="textColor" red="0.08235294118" green="0.08235294118" blue="0.08235294118" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_icloud_start" translatesAutoresizingMaskIntoConstraints="NO" id="CQO-7f-Ijg">
<rect key="frame" x="223.66666666666666" y="455.33333333333331" width="64.333333333333343" height="63.999999999999943"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_guide_zhaopian" translatesAutoresizingMaskIntoConstraints="NO" id="hqC-23-RfL">
<rect key="frame" x="24.666666666666657" y="110.33333333333331" width="357" height="365"/>
<constraints>
<constraint firstAttribute="height" constant="365" id="7gF-YC-st8" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="width" constant="357" id="Xfw-GQ-6e4" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
</constraints>
</imageView>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="zTf-gE-tij" firstAttribute="top" secondItem="6Jj-wZ-k87" secondAttribute="bottom" constant="6" id="5d1-pK-kse"/>
<constraint firstItem="qBA-8s-5RH" firstAttribute="top" secondItem="hqC-23-RfL" secondAttribute="bottom" constant="-20" id="7GW-sv-ul2"/>
<constraint firstItem="CQO-7f-Ijg" firstAttribute="centerY" secondItem="qBA-8s-5RH" secondAttribute="centerY" id="A5A-XN-oBv"/>
<constraint firstItem="FB0-xV-7Fl" firstAttribute="centerX" secondItem="qBA-8s-5RH" secondAttribute="centerX" id="Ai0-NL-BPB"/>
<constraint firstItem="FB0-xV-7Fl" firstAttribute="top" secondItem="qBA-8s-5RH" secondAttribute="bottom" constant="7" id="BbP-j5-291"/>
<constraint firstItem="hqC-23-RfL" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="Bkj-MA-UfR"/>
<constraint firstItem="zTf-gE-tij" firstAttribute="leading" secondItem="6Jj-wZ-k87" secondAttribute="leading" constant="9" id="C8d-f6-LuV"/>
<constraint firstItem="rde-nD-tAd" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="Dzx-ru-M0t"/>
<constraint firstItem="8t2-8U-jr2" firstAttribute="top" secondItem="CQO-7f-Ijg" secondAttribute="bottom" constant="7" id="FbX-wW-cB9"/>
<constraint firstItem="rde-nD-tAd" firstAttribute="leading" secondItem="qBA-8s-5RH" secondAttribute="trailing" constant="20" id="G4U-pj-mty"/>
<constraint firstItem="zTf-gE-tij" firstAttribute="trailing" secondItem="6Jj-wZ-k87" secondAttribute="trailing" constant="-9" id="Jac-ok-uJj"/>
<constraint firstItem="hqC-23-RfL" firstAttribute="top" secondItem="zTf-gE-tij" secondAttribute="bottom" id="Kjk-iq-RMW"/>
<constraint firstItem="rde-nD-tAd" firstAttribute="centerY" secondItem="qBA-8s-5RH" secondAttribute="centerY" id="Wte-6a-eoh"/>
<constraint firstItem="CQO-7f-Ijg" firstAttribute="leading" secondItem="rde-nD-tAd" secondAttribute="trailing" constant="20" id="aeF-zz-qp1"/>
<constraint firstItem="6Jj-wZ-k87" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="36" id="dT8-jX-bYu" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="8t2-8U-jr2" firstAttribute="centerX" secondItem="CQO-7f-Ijg" secondAttribute="centerX" id="hPa-89-92j"/>
<constraint firstItem="6Jj-wZ-k87" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="jLu-cq-4Om"/>
</constraints>
<size key="customSize" width="330" height="731"/>
<connections>
<outlet property="photoL" destination="FB0-xV-7Fl" id="9dX-pb-iYV"/>
</connections>
<point key="canvasLocation" x="358.77862595419845" y="269.36619718309862"/>
</collectionViewCell>
</objects>
<resources>
<image name="icon_guide_zhaopian" width="357" height="365"/>
<image name="img_icloud_start" width="64.333335876464844" height="64"/>
<image name="img_photos_start" width="64.333335876464844" height="64"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
...@@ -131,9 +131,8 @@ class HomePayView:UIView { ...@@ -131,9 +131,8 @@ class HomePayView:UIView {
self.addSubview(closeBtn!) self.addSubview(closeBtn!)
closeBtn?.snp.makeConstraints { make in closeBtn?.snp.makeConstraints { make in
// make.centerY.equalTo(restoreBtn!)
make.top.equalToSuperview().offset(statusBarHeight + 10) make.top.equalToSuperview().offset(statusBarHeight + 10)
make.right.equalToSuperview().offset(-15) make.left.equalToSuperview().offset(15)
make.width.height.equalTo(28) make.width.height.equalTo(28)
} }
...@@ -144,7 +143,7 @@ class HomePayView:UIView { ...@@ -144,7 +143,7 @@ class HomePayView:UIView {
self.addSubview(titleLabel1!) self.addSubview(titleLabel1!)
titleLabel1?.snp.makeConstraints { make in titleLabel1?.snp.makeConstraints { make in
make.top.equalToSuperview().offset(statusBarHeight + 68) make.top.equalToSuperview().offset(statusBarHeight + (ScreenH <= 667 ? 35 : 68.RH()))
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
} }
...@@ -167,7 +166,7 @@ class HomePayView:UIView { ...@@ -167,7 +166,7 @@ class HomePayView:UIView {
self.addSubview(photoImage) self.addSubview(photoImage)
photoImage.snp.makeConstraints { make in photoImage.snp.makeConstraints { make in
make.top.equalTo(titleLabel2!.snp.bottom).offset(38) make.top.equalTo(titleLabel2!.snp.bottom).offset(38.RH())
make.left.equalTo(48.RW()) make.left.equalTo(48.RW())
make.size.equalTo(64) make.size.equalTo(64)
} }
...@@ -275,7 +274,7 @@ class HomePayView:UIView { ...@@ -275,7 +274,7 @@ class HomePayView:UIView {
make.centerY.equalTo(appleLabel!) make.centerY.equalTo(appleLabel!)
make.right.equalToSuperview().offset(-marginLR) make.right.equalToSuperview().offset(-marginLR)
} }
payButton?.layer.cornerRadius = 25 payButton?.layer.cornerRadius = 32.5
payButton?.layer.masksToBounds = true payButton?.layer.masksToBounds = true
// 额外添加视图 // 额外添加视图
...@@ -294,13 +293,12 @@ class HomePayView:UIView { ...@@ -294,13 +293,12 @@ class HomePayView:UIView {
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.top.equalTo(payDueView.snp.bottom).offset(20) make.top.equalTo(payDueView.snp.bottom).offset(20)
make.width.equalToSuperview().offset(-30) make.width.equalToSuperview().offset(-30)
make.height.equalTo(50) make.height.equalTo(65)
}) })
contentView2?.layer.cornerRadius = 12 contentView2?.layer.cornerRadius = 12
contentView2?.layer.masksToBounds = true contentView2?.layer.masksToBounds = true
contentView2Title = UILabel() contentView2Title = UILabel()
contentView2Title?.text = "Free trial enabled" contentView2Title?.text = "Free trial enabled"
contentView2Title?.font = UIFont.systemFont(ofSize: 16, weight: .bold) contentView2Title?.font = UIFont.systemFont(ofSize: 16, weight: .bold)
...@@ -495,9 +493,9 @@ class HomePayView:UIView { ...@@ -495,9 +493,9 @@ class HomePayView:UIView {
} }
tipsView.snp.makeConstraints { make in tipsView.snp.makeConstraints { make in
make.top.equalTo(animationView.snp.bottom).offset(92) make.top.equalTo(animationView.snp.bottom).offset(ScreenH <= 667.0 ? 50 : 92.RH())
make.left.right.equalToSuperview().inset(12) make.left.right.equalToSuperview().inset(12)
make.height.equalTo(121) make.height.equalTo(110)
} }
let freespace = UILabel() let freespace = UILabel()
......
{"v":"5.4.3","fr":60,"ip":0,"op":132,"w":600,"h":400,"nm":"合成 1","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":32,"s":[0],"e":[-180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":51,"s":[-180],"e":[-180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":76,"s":[-180],"e":[0]},{"t":96}],"ix":10},"p":{"a":0,"k":[380,200,0],"ix":2},"a":{"a":0,"k":[-167,-5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":46,"s":[40,40],"e":[60,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":51,"s":[60,20],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":56,"s":[40,40],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":91,"s":[40,40],"e":[60,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":96,"s":[60,20],"e":[40,40]},{"t":101}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":32,"s":[40,0],"e":[80,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":42,"s":[80,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"n":"0p667_0p667_0p333_0p333","t":51,"s":[40,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":76,"s":[40,0],"e":[80,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":86,"s":[80,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"t":96}],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.262745098039,0.627450980392,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":46,"s":[-167,-5],"e":[-167,-15],"to":[0,-1.66666662693024],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":51,"s":[-167,-15],"e":[-167,-5],"to":[0,0],"ti":[0,-1.66666662693024]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"n":"0p667_0p667_0p333_0p333","t":56,"s":[-167,-5],"e":[-167,-5],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":91,"s":[-167,-5],"e":[-167,5],"to":[0,1.66666662693024],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":96,"s":[-167,5],"e":[-167,-5],"to":[0,0],"ti":[0,1.66666662693024]},{"t":101}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":200,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":24,"s":[0],"e":[-180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"n":["0p667_1_0p167_0"],"t":44,"s":[-180],"e":[-180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":84,"s":[-180],"e":[0]},{"t":104}],"ix":10},"p":{"a":0,"k":[300,200,0],"ix":2},"a":{"a":0,"k":[-167,-5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":39,"s":[40,40],"e":[60,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":44,"s":[60,20],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.167,0.167],"y":[0,0]},"n":["0p667_1_0p167_0","0p667_1_0p167_0"],"t":49,"s":[40,40],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":99,"s":[40,40],"e":[60,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":104,"s":[60,20],"e":[40,40]},{"t":109}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":24,"s":[40,0],"e":[80,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":34,"s":[80,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"n":"0p667_0p667_0p167_0p167","t":44,"s":[40,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":84,"s":[40,0],"e":[80,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":94,"s":[80,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"t":104}],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.262745098039,0.627450980392,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":39,"s":[-167,-5],"e":[-167,-15],"to":[0,-1.66666662693024],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":44,"s":[-167,-15],"e":[-167,-5],"to":[0,0],"ti":[0,-1.66666662693024]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"n":"0p667_0p667_0p167_0p167","t":49,"s":[-167,-5],"e":[-167,-5],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":99,"s":[-167,-5],"e":[-167,5],"to":[0,1.66666662693024],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":104,"s":[-167,5],"e":[-167,-5],"to":[0,0],"ti":[0,1.66666662693024]},{"t":109}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":200,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":16,"s":[0],"e":[-180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"n":["0p667_1_0p167_0"],"t":36,"s":[-180],"e":[-180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":92,"s":[-180],"e":[0]},{"t":112}],"ix":10},"p":{"a":0,"k":[220,200,0],"ix":2},"a":{"a":0,"k":[-167,-5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":31,"s":[40,40],"e":[60,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":36,"s":[60,20],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.167,0.167],"y":[0,0]},"n":["0p667_1_0p167_0","0p667_1_0p167_0"],"t":41,"s":[40,40],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":107,"s":[40,40],"e":[60,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":112,"s":[60,20],"e":[40,40]},{"t":117}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":16,"s":[40,0],"e":[80,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":26,"s":[80,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"n":"0p667_0p667_0p167_0p167","t":36,"s":[40,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":92,"s":[40,0],"e":[80,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":102,"s":[80,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"t":112}],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.262745098039,0.627450980392,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":31,"s":[-167,-5],"e":[-167,-15],"to":[0,-1.66666662693024],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":36,"s":[-167,-15],"e":[-167,-5],"to":[0,0],"ti":[0,-1.66666662693024]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"n":"0p667_0p667_0p167_0p167","t":41,"s":[-167,-5],"e":[-167,-5],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":107,"s":[-167,-5],"e":[-167,5],"to":[0,1.66666662693024],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":112,"s":[-167,5],"e":[-167,-5],"to":[0,0],"ti":[0,1.66666662693024]},{"t":117}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":200,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":8,"s":[0],"e":[-180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":28,"s":[-180],"e":[-180]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":100,"s":[-180],"e":[0]},{"t":120}],"ix":10},"p":{"a":0,"k":[140,200,0],"ix":2},"a":{"a":0,"k":[-167,-5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":23,"s":[40,40],"e":[60,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":28,"s":[60,20],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":33,"s":[40,40],"e":[40,40]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":115,"s":[40,40],"e":[60,20]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0"],"t":120,"s":[60,20],"e":[40,40]},{"t":125}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":8,"s":[40,0],"e":[80,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":18,"s":[80,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"n":"0p667_0p667_0p333_0p333","t":28,"s":[40,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":100,"s":[40,0],"e":[80,0],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":110,"s":[80,0],"e":[40,0],"to":[0,0],"ti":[0,0]},{"t":120}],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.262745098039,0.627450980392,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":23,"s":[-167,-5],"e":[-167,-15],"to":[0,-1.66666662693024],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":28,"s":[-167,-15],"e":[-167,-5],"to":[0,0],"ti":[0,-1.66666662693024]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"n":"0p667_0p667_0p333_0p333","t":33,"s":[-167,-5],"e":[-167,-5],"to":[0,0],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":115,"s":[-167,-5],"e":[-167,5],"to":[0,1.66666662693024],"ti":[0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":120,"s":[-167,5],"e":[-167,-5],"to":[0,0],"ti":[0,1.66666662693024]},{"t":125}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":200,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":0,"s":[100,200,0],"e":[420,200,0],"to":[53.3333320617676,0,0],"ti":[-53.3333320617676,0,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"n":"0p667_0p667_0p333_0p333","t":60,"s":[420,200,0],"e":[420,200,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":66,"s":[420,200,0],"e":[100,200,0],"to":[-53.3333320617676,0,0],"ti":[53.3333320617676,0,0]},{"t":126}],"ix":2},"a":{"a":0,"k":[-167,-5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[40,40],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":4,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.262745098039,0.627450980392,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-167,-5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":200,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"yuhecheng","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[340,200,0],"ix":2},"a":{"a":0,"k":[300,200,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":600,"h":400,"ip":0,"op":200,"st":0,"bm":0}],"markers":[{"tm":8,"cm":"1","dr":0},{"tm":16,"cm":"2","dr":0},{"tm":24,"cm":"3","dr":0},{"tm":32,"cm":"4","dr":0},{"tm":76,"cm":"5","dr":0},{"tm":84,"cm":"6","dr":0},{"tm":92,"cm":"7","dr":0},{"tm":100,"cm":"8","dr":0}]}
\ No newline at end of file
//
// PMLoadingView.swift
// PhoneManager
//
// Created by edy on 2025/4/28.
//
import UIKit
import Lottie
class PMLoadingHUD{
static let share = PMLoadingHUD()
lazy var loadingView:PMLoadingView = {
let loadingView = PMLoadingView()
loadingView.frame = CGRect(x: 0, y: 0, width: ScreenW, height: ScreenH)
return loadingView
}()
func show(){
DispatchQueue.main.async {
KEYWINDOW()?.addSubview(self.loadingView)
self.loadingView.animationView.play()
}
}
func disMiss(){
DispatchQueue.main.async {
self.loadingView.animationView.stop()
self.loadingView.removeFromSuperview()
}
}
}
class PMLoadingView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor.black.withAlphaComponent(0.8)
addSubview(animationView)
animationView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(300)
make.height.equalTo(200)
}
let title = UILabel()
title.text = "Deleting..."
title.textColor = .white
title.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
addSubview(title)
let subtitle = UILabel()
subtitle.text = "Please wait on the screen. This might take several minutes."
subtitle.textColor = .white
subtitle.numberOfLines = 0
subtitle.textAlignment = .center
subtitle.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
addSubview(subtitle)
title.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(animationView.snp.bottom).offset(-80)
}
subtitle.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.width.equalTo(250)
make.top.equalTo(title.snp.bottom).offset(2)
}
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
lazy var animationView : LottieAnimationView = {
let animationView = LottieAnimationView(name: "PMAnimationLoaing")
animationView.loopMode = .loop
return animationView
}()
}
...@@ -18,6 +18,8 @@ class CustomRate{ ...@@ -18,6 +18,8 @@ class CustomRate{
} }
class CustomRateView: UIView { class CustomRateView: UIView {
@IBOutlet weak var bgView: UIView! @IBOutlet weak var bgView: UIView!
......
...@@ -16,6 +16,7 @@ class DelSuccessViewController: UIViewController { ...@@ -16,6 +16,7 @@ class DelSuccessViewController: UIViewController {
@IBOutlet weak var points: UILabel! @IBOutlet weak var points: UILabel!
@IBOutlet weak var delText: UILabel! @IBOutlet weak var delText: UILabel!
@IBOutlet weak var conTitle: UILabel!
var delType:String = "photo" var delType:String = "photo"
var fileCount:Int = 0 var fileCount:Int = 0
...@@ -25,8 +26,15 @@ class DelSuccessViewController: UIViewController { ...@@ -25,8 +26,15 @@ class DelSuccessViewController: UIViewController {
super.viewDidLoad() super.viewDidLoad()
bottomBtn.layer.cornerRadius = 15 bottomBtn.layer.cornerRadius = 15
animationView.frame = CGRect(x: (ScreenW-250)/2+20, y: 80, width: 250, height: 250) // 设置 frame // animationView.frame = CGRect(x: (ScreenW-CGFloat(250.RH()))/2 + 20.RW(), y: 70.RH(), width: 250.RH(), height: 250.RH()) // 设置 frame
view.addSubview(animationView) view.addSubview(animationView)
animationView.snp.makeConstraints { make in
make.centerX.equalToSuperview().offset(20.RW())
make.bottom.equalTo(conTitle.snp.top).offset(15)
make.size.equalTo(250)
}
startAnimation() startAnimation()
reloadUI() reloadUI()
} }
...@@ -90,11 +98,6 @@ class DelSuccessViewController: UIViewController { ...@@ -90,11 +98,6 @@ class DelSuccessViewController: UIViewController {
let otherRange = (delTextString as NSString).range(of: "(\(formattedSize))") // 获取其他文本的范围 let otherRange = (delTextString as NSString).range(of: "(\(formattedSize))") // 获取其他文本的范围
delTextAttributedString.addAttribute(.foregroundColor, value: UIColor.colorWithHex(hexStr: "#1A1A1A"), range: otherRange) delTextAttributedString.addAttribute(.foregroundColor, value: UIColor.colorWithHex(hexStr: "#1A1A1A"), range: otherRange)
delText.attributedText = delTextAttributedString delText.attributedText = delTextAttributedString
} }
} }
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<connections> <connections>
<outlet property="bottomBtn" destination="LCj-Gz-gce" id="BOZ-jZ-MLX"/> <outlet property="bottomBtn" destination="LCj-Gz-gce" id="BOZ-jZ-MLX"/>
<outlet property="bottomText" destination="nIS-b5-Znx" id="ASM-VW-Ehs"/> <outlet property="bottomText" destination="nIS-b5-Znx" id="ASM-VW-Ehs"/>
<outlet property="conTitle" destination="Wuv-Jo-ClG" id="8fE-sb-OjD"/>
<outlet property="delText" destination="zkh-yv-aYk" id="ech-5X-5e2"/> <outlet property="delText" destination="zkh-yv-aYk" id="ech-5X-5e2"/>
<outlet property="points" destination="mhe-iG-xpQ" id="Txp-U4-fpy"/> <outlet property="points" destination="mhe-iG-xpQ" id="Txp-U4-fpy"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
...@@ -85,13 +86,13 @@ ...@@ -85,13 +86,13 @@
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="LCj-Gz-gce" secondAttribute="trailing" constant="15" id="0CP-MC-Lr5"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="LCj-Gz-gce" secondAttribute="trailing" constant="15" id="0CP-MC-Lr5"/>
<constraint firstItem="LCj-Gz-gce" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="2Xv-th-L23"/> <constraint firstItem="LCj-Gz-gce" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="2Xv-th-L23"/>
<constraint firstItem="V9c-pl-MwJ" firstAttribute="top" secondItem="Npn-Yc-tdh" secondAttribute="top" id="5QM-aj-IeW"/> <constraint firstItem="V9c-pl-MwJ" firstAttribute="top" secondItem="Npn-Yc-tdh" secondAttribute="top" id="5QM-aj-IeW"/>
<constraint firstItem="Wuv-Jo-ClG" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="246" id="D2b-Te-XzC"/> <constraint firstItem="Wuv-Jo-ClG" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="246" id="D2b-Te-XzC" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="gYc-Ja-g1G" firstAttribute="leading" secondItem="WJ0-hg-B3V" secondAttribute="trailing" constant="14" id="EhM-Yr-SAL"/> <constraint firstItem="gYc-Ja-g1G" firstAttribute="leading" secondItem="WJ0-hg-B3V" secondAttribute="trailing" constant="14" id="EhM-Yr-SAL"/>
<constraint firstItem="zkh-yv-aYk" firstAttribute="top" secondItem="Npn-Yc-tdh" secondAttribute="bottom" constant="9" id="EjO-a7-oYm"/> <constraint firstItem="zkh-yv-aYk" firstAttribute="top" secondItem="Npn-Yc-tdh" secondAttribute="bottom" constant="9" id="EjO-a7-oYm"/>
<constraint firstItem="zkh-yv-aYk" firstAttribute="leading" secondItem="V9c-pl-MwJ" secondAttribute="trailing" constant="14" id="H7C-tK-dfK"/> <constraint firstItem="zkh-yv-aYk" firstAttribute="leading" secondItem="V9c-pl-MwJ" secondAttribute="trailing" constant="14" id="H7C-tK-dfK"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="LCj-Gz-gce" secondAttribute="bottom" constant="30" id="Tfh-Lq-LH9"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="LCj-Gz-gce" secondAttribute="bottom" constant="30" id="Tfh-Lq-LH9"/>
<constraint firstItem="WJ0-hg-B3V" firstAttribute="trailing" secondItem="V9c-pl-MwJ" secondAttribute="trailing" id="Ua4-M7-B4Z"/> <constraint firstItem="WJ0-hg-B3V" firstAttribute="trailing" secondItem="V9c-pl-MwJ" secondAttribute="trailing" id="Ua4-M7-B4Z"/>
<constraint firstItem="V9c-pl-MwJ" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="43" id="Yy5-S5-Cya"/> <constraint firstItem="V9c-pl-MwJ" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="43" id="Yy5-S5-Cya" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="V9c-pl-MwJ" firstAttribute="top" secondItem="Wuv-Jo-ClG" secondAttribute="bottom" constant="43" id="Zve-oH-e3d"/> <constraint firstItem="V9c-pl-MwJ" firstAttribute="top" secondItem="Wuv-Jo-ClG" secondAttribute="bottom" constant="43" id="Zve-oH-e3d"/>
<constraint firstItem="nIS-b5-Znx" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="32" id="eXY-M7-Pr3"/> <constraint firstItem="nIS-b5-Znx" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="32" id="eXY-M7-Pr3"/>
<constraint firstItem="Npn-Yc-tdh" firstAttribute="leading" secondItem="V9c-pl-MwJ" secondAttribute="trailing" constant="14" id="fsX-Yg-e6H"/> <constraint firstItem="Npn-Yc-tdh" firstAttribute="leading" secondItem="V9c-pl-MwJ" secondAttribute="trailing" constant="14" id="fsX-Yg-e6H"/>
......
...@@ -23,7 +23,7 @@ class TipsDuplicatesSimilarController: UIViewController { ...@@ -23,7 +23,7 @@ class TipsDuplicatesSimilarController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
startBtn.layer.cornerRadius = 15 startBtn.layer.cornerRadius = 23
lineText.text = type.lineText lineText.text = type.lineText
iconOne.image = UIImage.init(named: type.tipOneIcon) iconOne.image = UIImage.init(named: type.tipOneIcon)
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/> <device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
...@@ -22,42 +22,42 @@ ...@@ -22,42 +22,42 @@
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_duplicates_1" translatesAutoresizingMaskIntoConstraints="NO" id="5sP-3G-R5V"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_duplicates_1" translatesAutoresizingMaskIntoConstraints="NO" id="5sP-3G-R5V">
<rect key="frame" x="41" y="202" width="299" height="137.33333333333337"/> <rect key="frame" x="41" y="143" width="281" height="137.5"/>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XMa-dY-JFG"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XMa-dY-JFG">
<rect key="frame" x="40" y="164" width="97" height="20"/> <rect key="frame" x="40" y="105" width="97" height="20"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_duplicates_1" translatesAutoresizingMaskIntoConstraints="NO" id="LIQ-mA-CKi"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_duplicates_1" translatesAutoresizingMaskIntoConstraints="NO" id="LIQ-mA-CKi">
<rect key="frame" x="41" y="397.33333333333331" width="299" height="137.33333333333331"/> <rect key="frame" x="41" y="338.5" width="281" height="137"/>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dRr-c6-YoB"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dRr-c6-YoB">
<rect key="frame" x="40" y="359.33333333333331" width="97" height="20"/> <rect key="frame" x="40" y="300.5" width="97" height="20"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U5t-M8-fCd"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U5t-M8-fCd">
<rect key="frame" x="128.33333333333334" y="561.66666666666663" width="124.66666666666666" height="30"/> <rect key="frame" x="119" y="502.5" width="125" height="30"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
<color key="textColor" red="0.10196078431372549" green="0.10196078431372549" blue="0.10196078431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.10196078431372549" green="0.10196078431372549" blue="0.10196078431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OOD-68-wMD"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OOD-68-wMD">
<rect key="frame" x="25" y="609.66666666666663" width="343" height="50.333333333333371"/> <rect key="frame" x="25" y="550.5" width="325" height="50.5"/>
<string key="text">These are duplicate photos - they are completely identical to each other. Immediately delete all duplicate items and keep the original version.</string> <string key="text">These are duplicate photos - they are completely identical to each other. Immediately delete all duplicate items and keep the original version.</string>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XPg-Ph-1k0"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XPg-Ph-1k0">
<rect key="frame" x="15" y="756" width="363" height="46"/> <rect key="frame" x="15" y="591" width="345" height="46"/>
<color key="backgroundColor" red="0.0" green="0.50980392156862742" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.50980392156862742" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="46" id="DDB-jE-Azu"/> <constraint firstAttribute="height" constant="46" id="DDB-jE-Azu"/>
...@@ -73,22 +73,22 @@ ...@@ -73,22 +73,22 @@
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="U5t-M8-fCd" firstAttribute="top" secondItem="LIQ-mA-CKi" secondAttribute="bottom" constant="27" id="1A7-xR-AKP"/> <constraint firstItem="U5t-M8-fCd" firstAttribute="top" secondItem="LIQ-mA-CKi" secondAttribute="bottom" constant="27" id="1A7-xR-AKP" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="XPg-Ph-1k0" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="8I8-jV-uJS"/> <constraint firstItem="XPg-Ph-1k0" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="8I8-jV-uJS"/>
<constraint firstItem="dRr-c6-YoB" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="BiE-te-3l5"/> <constraint firstItem="dRr-c6-YoB" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="BiE-te-3l5"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="XPg-Ph-1k0" secondAttribute="trailing" constant="15" id="Cb3-BS-U7O"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="XPg-Ph-1k0" secondAttribute="trailing" constant="15" id="Cb3-BS-U7O"/>
<constraint firstItem="5sP-3G-R5V" firstAttribute="top" secondItem="XMa-dY-JFG" secondAttribute="bottom" constant="18" id="TXF-uB-G74"/> <constraint firstItem="5sP-3G-R5V" firstAttribute="top" secondItem="XMa-dY-JFG" secondAttribute="bottom" constant="18" id="TXF-uB-G74" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="trailing" secondItem="OOD-68-wMD" secondAttribute="trailing" constant="25" id="Vcx-gz-lAI"/> <constraint firstAttribute="trailing" secondItem="OOD-68-wMD" secondAttribute="trailing" constant="25" id="Vcx-gz-lAI"/>
<constraint firstItem="XMa-dY-JFG" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="a0g-kE-ugQ"/> <constraint firstItem="XMa-dY-JFG" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="40" id="a0g-kE-ugQ"/>
<constraint firstItem="LIQ-mA-CKi" firstAttribute="leading" secondItem="5sP-3G-R5V" secondAttribute="leading" id="cqt-w5-eff"/> <constraint firstItem="LIQ-mA-CKi" firstAttribute="leading" secondItem="5sP-3G-R5V" secondAttribute="leading" id="cqt-w5-eff"/>
<constraint firstAttribute="bottom" secondItem="XPg-Ph-1k0" secondAttribute="bottom" constant="50" id="e8U-6l-271"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="XPg-Ph-1k0" secondAttribute="bottom" constant="30" id="dX6-cv-Gto" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="dRr-c6-YoB" firstAttribute="top" secondItem="5sP-3G-R5V" secondAttribute="bottom" constant="20" id="eD3-DG-qkC"/> <constraint firstItem="dRr-c6-YoB" firstAttribute="top" secondItem="5sP-3G-R5V" secondAttribute="bottom" constant="20" id="eD3-DG-qkC" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="5sP-3G-R5V" secondAttribute="trailing" constant="53" id="h2C-hf-maH"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="5sP-3G-R5V" secondAttribute="trailing" constant="53" id="h2C-hf-maH"/>
<constraint firstItem="OOD-68-wMD" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="25" id="jJ3-Yj-u0w"/> <constraint firstItem="OOD-68-wMD" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="25" id="jJ3-Yj-u0w"/>
<constraint firstItem="OOD-68-wMD" firstAttribute="top" secondItem="U5t-M8-fCd" secondAttribute="bottom" constant="18" id="lO2-YE-hId"/> <constraint firstItem="OOD-68-wMD" firstAttribute="top" secondItem="U5t-M8-fCd" secondAttribute="bottom" constant="18" id="lO2-YE-hId" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="XMa-dY-JFG" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="105" id="lQN-9H-9H5"/> <constraint firstItem="XMa-dY-JFG" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="85" id="lQN-9H-9H5" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="LIQ-mA-CKi" firstAttribute="trailing" secondItem="5sP-3G-R5V" secondAttribute="trailing" id="qKI-bl-RGS"/> <constraint firstItem="LIQ-mA-CKi" firstAttribute="trailing" secondItem="5sP-3G-R5V" secondAttribute="trailing" id="qKI-bl-RGS"/>
<constraint firstItem="LIQ-mA-CKi" firstAttribute="top" secondItem="dRr-c6-YoB" secondAttribute="bottom" constant="18" id="qWW-HD-yM0"/> <constraint firstItem="LIQ-mA-CKi" firstAttribute="top" secondItem="dRr-c6-YoB" secondAttribute="bottom" constant="18" id="qWW-HD-yM0" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="U5t-M8-fCd" firstAttribute="centerX" secondItem="LIQ-mA-CKi" secondAttribute="centerX" id="yXP-XE-VJ9"/> <constraint firstItem="U5t-M8-fCd" firstAttribute="centerX" secondItem="LIQ-mA-CKi" secondAttribute="centerX" id="yXP-XE-VJ9"/>
<constraint firstItem="5sP-3G-R5V" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="41" id="zUb-2g-3eW"/> <constraint firstItem="5sP-3G-R5V" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="41" id="zUb-2g-3eW"/>
</constraints> </constraints>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="tips_duplicates_1" width="281" height="137.33332824707031"/> <image name="tips_duplicates_1" width="281" height="137.5"/>
<systemColor name="systemBackgroundColor"> <systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor> </systemColor>
......
...@@ -13,7 +13,7 @@ class TipsScreenShotController: UIViewController { ...@@ -13,7 +13,7 @@ class TipsScreenShotController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
startBtn.layer.cornerRadius = 15 startBtn.layer.cornerRadius = 23
} }
......
...@@ -21,7 +21,11 @@ ...@@ -21,7 +21,11 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_sreenshot" translatesAutoresizingMaskIntoConstraints="NO" id="QGK-yy-jOF"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_sreenshot" translatesAutoresizingMaskIntoConstraints="NO" id="QGK-yy-jOF">
<rect key="frame" x="17" y="105" width="396" height="396"/> <rect key="frame" x="44.666666666666657" y="105" width="341" height="396"/>
<constraints>
<constraint firstAttribute="height" constant="396" id="SIW-Kc-ZGi" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="width" constant="341" id="hZh-ma-7Bw" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
</constraints>
</imageView> </imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ybT-3z-Wb2"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ybT-3z-Wb2">
<rect key="frame" x="15" y="822" width="400" height="46"/> <rect key="frame" x="15" y="822" width="400" height="46"/>
...@@ -55,15 +59,14 @@ ...@@ -55,15 +59,14 @@
<constraints> <constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="ybT-3z-Wb2" secondAttribute="trailing" constant="15" id="1CR-10-bnb"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="ybT-3z-Wb2" secondAttribute="trailing" constant="15" id="1CR-10-bnb"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="VkR-UI-FBK" secondAttribute="trailing" constant="25" id="4JU-rc-hns"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="VkR-UI-FBK" secondAttribute="trailing" constant="25" id="4JU-rc-hns"/>
<constraint firstItem="QGK-yy-jOF" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="17" id="I80-yL-ctf"/>
<constraint firstItem="ybT-3z-Wb2" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="IIW-NA-SQU"/> <constraint firstItem="ybT-3z-Wb2" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="IIW-NA-SQU"/>
<constraint firstItem="QGK-yy-jOF" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="Kee-LL-a9m"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="ybT-3z-Wb2" secondAttribute="bottom" constant="30" id="NWj-ld-9UY"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="ybT-3z-Wb2" secondAttribute="bottom" constant="30" id="NWj-ld-9UY"/>
<constraint firstItem="VkR-UI-FBK" firstAttribute="top" secondItem="h8I-lL-ELV" secondAttribute="bottom" constant="18" id="aYz-ey-Yc7"/> <constraint firstItem="VkR-UI-FBK" firstAttribute="top" secondItem="h8I-lL-ELV" secondAttribute="bottom" constant="18" id="aYz-ey-Yc7"/>
<constraint firstItem="QGK-yy-jOF" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="46" id="cHD-Cc-XiT"/> <constraint firstItem="QGK-yy-jOF" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="46" id="cHD-Cc-XiT"/>
<constraint firstItem="h8I-lL-ELV" firstAttribute="top" secondItem="QGK-yy-jOF" secondAttribute="bottom" constant="55" id="dDM-Pu-5g1"/> <constraint firstItem="h8I-lL-ELV" firstAttribute="top" secondItem="QGK-yy-jOF" secondAttribute="bottom" constant="55" id="dDM-Pu-5g1"/>
<constraint firstItem="VkR-UI-FBK" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="25" id="qMJ-l4-yde"/> <constraint firstItem="VkR-UI-FBK" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="25" id="qMJ-l4-yde"/>
<constraint firstItem="h8I-lL-ELV" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="qMT-Hi-GFU"/> <constraint firstItem="h8I-lL-ELV" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="qMT-Hi-GFU"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="QGK-yy-jOF" secondAttribute="trailing" constant="17" id="tuK-Vk-YgB"/>
</constraints> </constraints>
<point key="canvasLocation" x="82" y="24"/> <point key="canvasLocation" x="82" y="24"/>
</view> </view>
......
...@@ -19,7 +19,7 @@ class TipsVideoPhotoController: UIViewController { ...@@ -19,7 +19,7 @@ class TipsVideoPhotoController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
startBtn.layer.cornerRadius = 15 startBtn.layer.cornerRadius = 23
icon.image = UIImage.init(named: type.tipOneIcon) icon.image = UIImage.init(named: type.tipOneIcon)
......
...@@ -24,16 +24,16 @@ ...@@ -24,16 +24,16 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_photos" translatesAutoresizingMaskIntoConstraints="NO" id="OpM-5k-AoO"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_photos" translatesAutoresizingMaskIntoConstraints="NO" id="OpM-5k-AoO">
<rect key="frame" x="65.666666666666686" y="169" width="262" height="306"/> <rect key="frame" x="65.666666666666686" y="159" width="262" height="306"/>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Other photos" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dcU-ld-SUp"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Other photos" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dcU-ld-SUp">
<rect key="frame" x="119.66666666666667" y="555" width="153.66666666666663" height="30"/> <rect key="frame" x="119.66666666666667" y="545" width="153.66666666666663" height="30"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
<color key="textColor" red="0.1019607843" green="0.1019607843" blue="0.1019607843" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.1019607843" green="0.1019607843" blue="0.1019607843" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="These are photos that do not belong to any category. Sort them by size or date. Delete unnecessary photos." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LeZ-aM-wDE"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="These are photos that do not belong to any category. Sort them by size or date. Delete unnecessary photos." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LeZ-aM-wDE">
<rect key="frame" x="25" y="603" width="343" height="50.333333333333371"/> <rect key="frame" x="25" y="593" width="343" height="50.333333333333371"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -56,13 +56,13 @@ ...@@ -56,13 +56,13 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="OpM-5k-AoO" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="0N1-Db-xJx"/> <constraint firstItem="OpM-5k-AoO" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="0N1-Db-xJx"/>
<constraint firstItem="OpM-5k-AoO" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="110" id="BQx-h1-esb"/> <constraint firstItem="OpM-5k-AoO" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="100" id="BQx-h1-esb" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="trailing" secondItem="KHL-A7-P8d" secondAttribute="trailing" constant="15" id="MaN-MT-FnY"/> <constraint firstAttribute="trailing" secondItem="KHL-A7-P8d" secondAttribute="trailing" constant="15" id="MaN-MT-FnY"/>
<constraint firstItem="dcU-ld-SUp" firstAttribute="top" secondItem="OpM-5k-AoO" secondAttribute="bottom" constant="80" id="Okf-QC-Jrn"/> <constraint firstItem="dcU-ld-SUp" firstAttribute="top" secondItem="OpM-5k-AoO" secondAttribute="bottom" constant="80" id="Okf-QC-Jrn" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="KHL-A7-P8d" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="Rl4-Mh-CiF"/> <constraint firstItem="KHL-A7-P8d" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="15" id="Rl4-Mh-CiF"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="KHL-A7-P8d" secondAttribute="bottom" constant="30" id="SCz-tZ-pgH"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="KHL-A7-P8d" secondAttribute="bottom" constant="30" id="SCz-tZ-pgH"/>
<constraint firstItem="dcU-ld-SUp" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="USR-RC-nO5"/> <constraint firstItem="dcU-ld-SUp" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="USR-RC-nO5"/>
<constraint firstItem="LeZ-aM-wDE" firstAttribute="top" secondItem="dcU-ld-SUp" secondAttribute="bottom" constant="18" id="Zga-Sv-DYE"/> <constraint firstItem="LeZ-aM-wDE" firstAttribute="top" secondItem="dcU-ld-SUp" secondAttribute="bottom" constant="18" id="Zga-Sv-DYE" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="LeZ-aM-wDE" secondAttribute="trailing" constant="25" id="lAh-or-e83"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="LeZ-aM-wDE" secondAttribute="trailing" constant="25" id="lAh-or-e83"/>
<constraint firstItem="LeZ-aM-wDE" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="25" id="plq-KA-cxw"/> <constraint firstItem="LeZ-aM-wDE" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="25" id="plq-KA-cxw"/>
</constraints> </constraints>
......
...@@ -2,7 +2,14 @@ import UserNotifications ...@@ -2,7 +2,14 @@ import UserNotifications
class NotificationManager { class NotificationManager {
private var photos:Int = 10
private var videos:Int = 10
private var duplicates:Int = 10
private var similar:Int = 10
private var duplicatesSize:String = "100 MB"
func configNotifications(){ func configNotifications(){
if let secondlaunch = UserDefaults.standard.value(forKey: "notifications_is_secondlaunch") as? Bool{ if let secondlaunch = UserDefaults.standard.value(forKey: "notifications_is_secondlaunch") as? Bool{
if secondlaunch{ if secondlaunch{
Print("二次启动,获取通知权限") Print("二次启动,获取通知权限")
...@@ -22,8 +29,7 @@ class NotificationManager { ...@@ -22,8 +29,7 @@ class NotificationManager {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { granted, error in UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { granted, error in
if granted { if granted {
// 创建并调度通知 // 创建并调度通知
// self.createNotifications() self.getCacheData()
self.scheduleNotificationsEveryTwoMinutes()
} else { } else {
print("通知权限未被授予: \(String(describing: error))") print("通知权限未被授予: \(String(describing: error))")
} }
...@@ -32,11 +38,6 @@ class NotificationManager { ...@@ -32,11 +38,6 @@ class NotificationManager {
// 创建并调度通知 // 创建并调度通知
private func createNotifications() { private func createNotifications() {
let content = UNMutableNotificationContent()
content.title = NotificationManagerData().getShowTitle()
content.body = NotificationManagerData().getAlertSubtitle()
content.sound = UNNotificationSound.default
// 定义每天的通知时间 // 定义每天的通知时间
let notificationTimes = [ let notificationTimes = [
(hour: 9, minute: 0), // 早上 9 点 (hour: 9, minute: 0), // 早上 9 点
...@@ -45,7 +46,7 @@ class NotificationManager { ...@@ -45,7 +46,7 @@ class NotificationManager {
] ]
// 创建通知 // 创建通知
for time in notificationTimes { for (index, time) in notificationTimes.enumerated() {
var dateComponents = DateComponents() var dateComponents = DateComponents()
dateComponents.hour = time.hour dateComponents.hour = time.hour
dateComponents.minute = time.minute dateComponents.minute = time.minute
...@@ -53,6 +54,12 @@ class NotificationManager { ...@@ -53,6 +54,12 @@ class NotificationManager {
// 设置触发条件为每天 // 设置触发条件为每天
let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true) let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: true)
// 创建通知内容
let content = UNMutableNotificationContent()
content.title = getAlertMessage(index: index).0 // 根据时间点选择标题
content.body = getAlertMessage(index: index).1 // 根据时间点选择消息
content.sound = UNNotificationSound.default
// 创建请求 // 创建请求
let request = UNNotificationRequest(identifier: "\(time.hour)-\(time.minute)", content: content, trigger: trigger) let request = UNNotificationRequest(identifier: "\(time.hour)-\(time.minute)", content: content, trigger: trigger)
...@@ -68,15 +75,17 @@ class NotificationManager { ...@@ -68,15 +75,17 @@ class NotificationManager {
// 每 2 分钟调度一次通知 // 每 2 分钟调度一次通知
func scheduleNotificationsEveryTwoMinutes() { func scheduleNotificationsEveryTwoMinutes() {
let content = UNMutableNotificationContent() let content = UNMutableNotificationContent()
content.title = NotificationManagerData().getShowTitle() content.title = ""//getAlertMessage().0
content.body = NotificationManagerData().getAlertSubtitle() content.body = ""//getAlertMessage().1
content.sound = UNNotificationSound.default content.sound = UNNotificationSound.default
// 创建触发条件为每 2 分钟 // 创建触发条件为每 2 分钟
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 600, repeats: true) let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 60, repeats: true)
// 创建请求 // 创建请求
let request = UNNotificationRequest(identifier: "twoMinuteNotification", content: content, trigger: trigger) let date = Date().getDateString()
let id = date
let request = UNNotificationRequest(identifier: id, content: content, trigger: trigger)
// 添加请求到通知中心 // 添加请求到通知中心
UNUserNotificationCenter.current().add(request) { error in UNUserNotificationCenter.current().add(request) { error in
...@@ -91,17 +100,87 @@ class NotificationManager { ...@@ -91,17 +100,87 @@ class NotificationManager {
UNUserNotificationCenter.current().removeAllPendingNotificationRequests() UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
print("所有本地通知已被取消") print("所有本地通知已被取消")
} }
func getCacheData(){
PhotoDataManager.manager.loadFromFileSystem(resultModel: { model in
if let duplicates = model.titleModelArray.safeGet(index: 0)?.assets{
self.duplicates = duplicates.count
}
if let size = model.titleModelArray.safeGet(index: 0)?.allFileSize{
self.duplicatesSize = FileTool().formatBytes(Int64(size))
}
if let similar = model.titleModelArray.safeGet(index: 1)?.assets{
self.similar = similar.count
}
if let videos = model.otherModelArray.safeGet(index: 0)?.assets{
self.videos = videos.count
}
if let photos = model.otherModelArray.safeGet(index: 4)?.assets{
self.photos = photos.count
}
Print("缓存数据获取完成,注册通知")
self.createNotifications()
})
}
func getAlertMessage(index:Int) ->(String,String){
let titlts = ["You can free up more storage space!",
"More space is waiting to be cleared up",
"Arrange the photos in a secret space to gain more space!"]
let message = ["\(self.videos) videos and \(self.photos) photos are waiting in the \"video&others\" section.",
"\(self.duplicates) photos are waiting to be cleaned up in duplicates, approximately \(duplicatesSize).",
"\(self.similar) photos are placed in the \"Secret Space\" to free up more storage space."]
return (titlts[index],message[index])
}
} }
struct NotificationManagerData{
func getShowTitle() ->String{
return "You can free up more storage space!"
// 扩展 Array
extension Array {
// 安全获取元素的方法
func safeGet(index: Int) -> Element? {
// 检查索引是否在有效范围内
guard index >= 0 && index < self.count else {
print("Index \(index) is out of bounds for array of size \(self.count).")
return nil // 返回 nil 表示越界
} }
return self[index] // 返回对应的元素
}
}
extension Date {
/// 将 Date 转换为指定格式的字符串
/// - Parameter format: 日期格式字符串
/// - Returns: 格式化后的日期字符串
func toString(format: String) -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = format
return dateFormatter.string(from: self)
}
func getDateString(format:String = "yyyy-MM-dd HH:mm") ->String{
func getAlertSubtitle() ->String{ let dateFormatter = DateFormatter.init()
return "100 videos and 100 photos are waiting in the \"video&others\" section." dateFormatter.dateFormat = format
dateFormatter.locale = .current
let dateStr = dateFormatter.string(from: self)
return dateStr
} }
} }
...@@ -697,6 +697,7 @@ class PhotoAndVideoMananger { ...@@ -697,6 +697,7 @@ class PhotoAndVideoMananger {
let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: localIdentifiers, options: nil) let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: localIdentifiers, options: nil)
// 开始删除操作 // 开始删除操作
PMLoadingHUD.share.show()
PHPhotoLibrary.shared().performChanges({ PHPhotoLibrary.shared().performChanges({
// 创建删除请求 // 创建删除请求
PHAssetChangeRequest.deleteAssets(fetchResult) PHAssetChangeRequest.deleteAssets(fetchResult)
...@@ -704,6 +705,7 @@ class PhotoAndVideoMananger { ...@@ -704,6 +705,7 @@ class PhotoAndVideoMananger {
if success { if success {
suc() suc()
} else if let error = error { } else if let error = error {
PMLoadingHUD.share.disMiss()
print("删除失败: \(error.localizedDescription)") print("删除失败: \(error.localizedDescription)")
} }
} }
...@@ -1175,14 +1177,20 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro ...@@ -1175,14 +1177,20 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro
func deleteAssets(_ assets:[PHAsset] = []) -> Void { func deleteAssets(_ assets:[PHAsset] = []) -> Void {
if assets.count > 0 { if assets.count > 0 {
PMLoadingHUD.share.show()
PHPhotoLibrary.shared().performChanges({ PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.deleteAssets(assets as NSFastEnumeration) PHAssetChangeRequest.deleteAssets(assets as NSFastEnumeration)
}) { success, error in }) { success, error in
if success { if success {
print("删除成功") print("删除成功")
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
PMLoadingHUD.share.disMiss()
}
} else if let error = error { } else if let error = error {
print("删除失败: \(error.localizedDescription)") print("删除失败: \(error.localizedDescription)")
} }
} }
} }
} }
......
...@@ -63,3 +63,16 @@ func RScreenH() -> CGFloat { ...@@ -63,3 +63,16 @@ func RScreenH() -> CGFloat {
return radio return radio
} }
let kSafeAreaInsets:UIEdgeInsets = kcWindow.safeAreaInsets
let kcWindow:UIWindow = {
if #available(iOS 13, *) {
return UIApplication.shared.connectedScenes
.compactMap { $0 as? UIWindowScene }
.first?.windows.first ?? UIWindow()
} else {
return UIApplication.shared.keyWindow ?? UIWindow()
}
}()
...@@ -245,6 +245,9 @@ extension Date { ...@@ -245,6 +245,9 @@ extension Date {
return toDate return toDate
} }
} }
extension SKProduct { extension SKProduct {
...@@ -259,3 +262,44 @@ extension SKProduct { ...@@ -259,3 +262,44 @@ extension SKProduct {
return formatter.string(from: priceNumber) ?? "" return formatter.string(from: priceNumber) ?? ""
} }
} }
var borderWKey = "borderWKey"
var borderCKey = "borderCKey"
@IBDesignable
extension UIView {
@IBInspectable var Radius:Double {
set {
self.layer.cornerRadius = newValue
self.clipsToBounds = true
}
get {
return 0
}
}
@IBInspectable var borderColor:UIColor {
set {
self.layer.borderColor = newValue.cgColor
self.layer.borderWidth = self.borderWidth
self.clipsToBounds = true
objc_setAssociatedObject(self, &borderCKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
get {
return objc_getAssociatedObject(self, &borderCKey) as? UIColor ?? UIColor.clear
}
}
@IBInspectable var borderWidth:Double {
set {
self.layer.borderColor = self.borderColor.cgColor
self.layer.borderWidth = newValue
self.clipsToBounds = true
objc_setAssociatedObject(self, &borderWKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
get {
return objc_getAssociatedObject(self, &borderWKey) as? Double ?? 0.0
}
}
}
//
// ScreenHeightRatioConstraint.swift
// PhoneManager
//
// Created by edy on 2025/4/28.
//
import Foundation
import UIKit
class ScreenHeightRatioConstraint: NSLayoutConstraint {
// 存储比例基准值(812)
private let standardHeight: CGFloat = 812.0
override func awakeFromNib() {
super.awakeFromNib()
updateConstant()
}
private func updateConstant() {
// 获取当前屏幕高度
let screenHeight = UIScreen.main.bounds.height
// 确保 screenHeight 和 standardHeight 都是有效的
guard standardHeight.isFinite && screenHeight.isFinite else {
self.constant = 0 // 设置为默认值以避免崩溃
return
}
// 计算新的约束常量(直接使用屏幕高度与标准高度的比率)
let calculatedConstant = (screenHeight / 812.0) * self.constant
// 检查 calculatedConstant 是否为有限值
if calculatedConstant.isFinite {
self.constant = calculatedConstant
} else {
self.constant = 0 // 设置为默认值以避免崩溃
}
}
}
class ScreenWidthRatioConstraint: NSLayoutConstraint {
// 存储比例基准值(812)
private let standardWidth: CGFloat = 375.0
override func awakeFromNib() {
super.awakeFromNib()
updateConstant()
}
private func updateConstant() {
// 获取当前屏幕高度
let screenWidth = UIScreen.main.bounds.width
// 确保 screenHeight 和 standardHeight 都是有效的
guard standardWidth.isFinite && screenWidth.isFinite else {
self.constant = 0 // 设置为默认值以避免崩溃
return
}
// 计算新的约束常量(直接使用屏幕高度与标准高度的比率)
let calculatedConstant = (screenWidth / 375.0) * self.constant
// 检查 calculatedConstant 是否为有限值
if calculatedConstant.isFinite {
self.constant = calculatedConstant
} else {
self.constant = 0 // 设置为默认值以避免崩溃
}
}
}
...@@ -100,3 +100,51 @@ extension UILabel { ...@@ -100,3 +100,51 @@ extension UILabel {
} }
} }
} }
extension UILabel {
/// 获取label高度
/// - Parameters:
/// - maxSize: 最大高度,宽
/// - Returns: <#description#>
public func textHeight() -> CGSize {
let maxSize = CGSize(width: ScreenW, height: CGFloat(MAXFLOAT))
let attributedStr = NSMutableAttributedString.init(string: text ?? "")
let size = attributedStr.boundingRect(with: maxSize, options: .usesLineFragmentOrigin, context: nil).size
return size
}
/// 根据高度动态计算宽度(new)
func getLabelWidth(height: CGFloat) -> CGFloat {
return sizeThatFits(CGSize(width:CGFloat(MAXFLOAT), height: height)).width
}
/// 根据宽度动态计算高度(new)
func getLabelHeight(width: CGFloat) -> CGFloat {
return sizeThatFits(CGSize(width:width, height: CGFloat(MAXFLOAT))).height
}
/// 中间加下划线
func addLineInMiddle() {
guard let text = text else { return }
let attribute = NSMutableAttributedString.init(string: text)
attribute.addAttribute(NSAttributedString.Key.strikethroughStyle, value: NSNumber.init(value: 1), range: NSRange(location: 0, length: text.count))
attributedText = attribute
}
/// 中间加下划线
func addUnderline() {
guard let text = text else { return }
let attribute = NSMutableAttributedString(string: text)
// 添加下划线属性
attribute.addAttribute(NSAttributedString.Key.underlineStyle, value: NSUnderlineStyle.single.rawValue, range: NSRange(location: 0, length: text.count))
// 设置 UILabel 的 attributedText
attributedText = attribute
}
}
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