Commit 59bbb91d 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:
  优化ui,内购处理

# Conflicts:
#	PhoneManager/Class/Tool/Class/PhotoAndVideoMananger/PhotoAndVideoMananger.swift
parents 6591ae36 49b751ca
...@@ -270,7 +270,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -270,7 +270,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private func setupDefault() { private func setupDefault() {
HomePayModel.share.loadLocalData() // HomePayModel.share.loadLocalData()
HomePayModel.share.checkSubscriptionState { isSubscribed, expiresDate in
}
NetStatusManager.manager.startNet { status in NetStatusManager.manager.startNet { status in
switch status { switch status {
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "queshengtu@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -109,12 +109,14 @@ class HomeInfoViewController:BaseViewController { ...@@ -109,12 +109,14 @@ class HomeInfoViewController:BaseViewController {
func updateFreeTimes(){ func updateFreeTimes(){
// 删除成功后更新次数 // 删除成功后更新次数
var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as! Int if var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as? Int{
if times > 0 { if times > 0 {
// 如果免费次数大于0 // 如果免费次数大于0
times = times - 1 times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes") UserDefaults.standard.set(times, forKey: "saveAdvTimes")
}
} }
} }
setDefaultPage() setDefaultPage()
......
...@@ -292,8 +292,6 @@ class HomeViewController:BaseViewController { ...@@ -292,8 +292,6 @@ class HomeViewController:BaseViewController {
} }
} }
} }
} }
// 重复图片 // 重复图片
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import UIKit import UIKit
import StoreKit import StoreKit
import SVProgressHUD
class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObserver { class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObserver {
...@@ -23,8 +24,10 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs ...@@ -23,8 +24,10 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs
var state:PayState = .Subscribe var state:PayState = .Subscribe
private let productIdentifiers:[String] = ["com.app.phonemanager.year.member" , "com.app.phonemanager.lifetime.member"] private let productIdentifiers:[String] = ["com.app.phonemanager.week.member" , "com.app.phonemanager.lifetime.member"]
var isSubscribed:Bool = false
var isNoAd:Bool { var isNoAd:Bool {
get { get {
guard let noabd = UserDefaults.standard.object(forKey: "noabd") as? Bool else { return false } guard let noabd = UserDefaults.standard.object(forKey: "noabd") as? Bool else { return false }
...@@ -61,7 +64,7 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs ...@@ -61,7 +64,7 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs
private func checkTrialStatus() -> Void { private func checkTrialStatus() -> Void {
if state == .Subscribe { // 订阅型 if state == .Subscribe { // 订阅型
verifyReceiptWithApple { receipt in verifyReceiptWithApple { receipt in
self.alert.dismiss() self.alert.disMiss()
guard let json = receipt else { guard let json = receipt else {
self.refreshReceipt() self.refreshReceipt()
return return
...@@ -78,10 +81,12 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs ...@@ -78,10 +81,12 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs
}else{ }else{
self.isNoAd = false self.isNoAd = false
} }
DismissPresen()
} }
}else{ }else{
self.alert.dismiss() self.alert.disMiss()
self.isNoAd = true self.isNoAd = true
DismissPresen()
} }
} }
...@@ -168,31 +173,55 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs ...@@ -168,31 +173,55 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs
/** 获取商品列表 */ /** 获取商品列表 */
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) { func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
let products = response.products let products = response.products
var ps:[SKProduct?] = [nil,nil] var ps:[SKProduct] = []
if products.count >= 2 { if products.count >= 2 {
if products.first?.productIdentifier == productIdentifiers.first {
ps[0] = products.first if let first = products.first,let last = products.last{
ps[1] = products.last
}else{ if first.productIdentifier == productIdentifiers.first{
ps[1] = products.first ps = [first,last]
ps[0] = products.last }else{
ps = [last,first]
}
} }
}else{
ps = products
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {
Print("获取商品信息成功") Print("获取商品信息成功")
if self.getCachedProduct(forIdentifier: self.productIdentifiers)?.count == 0 { self.product = ps
Print("获取商品信息成功--缓存没有数据由请求提供") DispatchQueue.main.async{
self.product = ps
self.storeCall(ps) self.storeCall(ps)
self.cacheProducts(ps)
BackgroundTaskManager.share.endTask()
} }
Print("开始缓存商品信息") }else{
self.cacheProducts(products) self.product = products
Print("缓存商品信息成功") }
BackgroundTaskManager.share.endTask()
// if products.count >= 2 {
}) // if products.first?.productIdentifier == productIdentifiers.first {
//
// ps = [products.first,products.last]
// }else{
// ps = [products.last,products.first]
// }
// }else{
// ps = products
// }
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {
// Print("获取商品信息成功")
// if self.getCachedProduct(forIdentifier: self.productIdentifiers)?.count == 0 {
// Print("获取商品信息成功--缓存没有数据由请求提供")
// self.product = ps
// self.storeCall(ps)
// }
// Print("开始缓存商品信息")
// self.cacheProducts(products)
// Print("缓存商品信息成功")
// BackgroundTaskManager.share.endTask()
//
// })
} }
func request(_ request: SKRequest, didFailWithError error: Error) { func request(_ request: SKRequest, didFailWithError error: Error) {
...@@ -208,14 +237,14 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs ...@@ -208,14 +237,14 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs
self.state = states self.state = states
let payment = SKPayment(product: states == .Subscribe ? p1! : p2!) let payment = SKPayment(product: states == .Subscribe ? p1! : p2!)
SKPaymentQueue.default().add(payment) SKPaymentQueue.default().add(payment)
alert.show() alert.show("Loading... Please wait.","")
} }
/** 恢复 */ /** 恢复 */
func restore(_ states:PayState = .Subscribe) -> Void { func restore(_ states:PayState = .Subscribe) -> Void {
self.state = states self.state = states
SKPaymentQueue.default().restoreCompletedTransactions() SKPaymentQueue.default().restoreCompletedTransactions()
alert.show() alert.show("Loading... Please wait.","")
} }
override init() { override init() {
...@@ -223,7 +252,7 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs ...@@ -223,7 +252,7 @@ class HomePayModel: NSObject ,SKProductsRequestDelegate ,SKPaymentTransactionObs
SKPaymentQueue.default().add(self) SKPaymentQueue.default().add(self)
} }
let alert = PMAlertView() let alert = PMLoadingHUD.share
} }
...@@ -242,7 +271,7 @@ extension HomePayModel { ...@@ -242,7 +271,7 @@ extension HomePayModel {
break break
case .failed: case .failed:
Print("购买失败") Print("购买失败")
alert.dismiss() alert.disMiss()
SKPaymentQueue.default().finishTransaction(transaction) SKPaymentQueue.default().finishTransaction(transaction)
break break
case .restored: case .restored:
...@@ -379,7 +408,7 @@ extension HomePayModel { ...@@ -379,7 +408,7 @@ extension HomePayModel {
/** 恢复失败 */ /** 恢复失败 */
func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: any Error) { func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: any Error) {
alert.dismiss() alert.disMiss()
} }
/** 刷新收据 */ /** 刷新收据 */
...@@ -390,6 +419,38 @@ extension HomePayModel { ...@@ -390,6 +419,38 @@ extension HomePayModel {
} }
} }
extension HomePayModel {
/// 检查订阅状态
/// - Parameter completion: 回调闭包,返回订阅状态和到期时间
func checkSubscriptionState(completion: @escaping (_ isSubscribed: Bool, _ expiresDate: Date?) -> Void) {
verifyReceiptWithApple { receipt in
guard let json = receipt else {
self.refreshReceipt()
completion(false, nil)
return
}
let status = self.checkSubscriptionStatus(receiptInfo: json)
DispatchQueue.main.async {
completion(status.isActive, status.expiresDate)
// 更新本地订阅状态
self.isNoAd = status.isActive
self.isSubscribed = status.isActive
#if DEBUG
if let expDate = status.expiresDate {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
Print("订阅状态:\(status.isActive ? "已订阅" : "未订阅"),到期时间:\(formatter.string(from: expDate))")
}
#endif
}
}
}
}
extension Notification.Name { extension Notification.Name {
static let HelperPurchaseNotification = Notification.Name("PhoneManagerisStore") static let HelperPurchaseNotification = Notification.Name("PhoneManagerisStore")
} }
...@@ -132,7 +132,7 @@ class HomePayView:UIView { ...@@ -132,7 +132,7 @@ class HomePayView:UIView {
closeBtn?.snp.makeConstraints { make in closeBtn?.snp.makeConstraints { make in
make.top.equalToSuperview().offset(statusBarHeight + 10) make.top.equalToSuperview().offset(statusBarHeight + 10)
make.left.equalToSuperview().offset(15) make.right.equalToSuperview().offset(-15)
make.width.height.equalTo(28) make.width.height.equalTo(28)
} }
......
...@@ -18,9 +18,10 @@ class PMLoadingHUD{ ...@@ -18,9 +18,10 @@ class PMLoadingHUD{
return loadingView return loadingView
}() }()
func show(){ func show(_ title:String = "Deleting...",_ subTitle:String = "Please wait on the screen. This might take several minutes."){
DispatchQueue.main.async { DispatchQueue.main.async {
KEYWINDOW()?.addSubview(self.loadingView) KEYWINDOW()?.addSubview(self.loadingView)
self.loadingView.setTitleaAndSubTitle(title: title, subTitle: subTitle)
self.loadingView.animationView.play() self.loadingView.animationView.play()
} }
} }
...@@ -31,10 +32,19 @@ class PMLoadingHUD{ ...@@ -31,10 +32,19 @@ class PMLoadingHUD{
self.loadingView.removeFromSuperview() self.loadingView.removeFromSuperview()
} }
} }
func setTimerDismiss(){
}
} }
class PMLoadingView: UIView { class PMLoadingView: UIView {
var title:UILabel!
var subtitle:UILabel!
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
...@@ -48,13 +58,13 @@ class PMLoadingView: UIView { ...@@ -48,13 +58,13 @@ class PMLoadingView: UIView {
make.height.equalTo(200) make.height.equalTo(200)
} }
let title = UILabel() title = UILabel()
title.text = "Deleting..." title.text = "Deleting..."
title.textColor = .white title.textColor = .white
title.font = UIFont.systemFont(ofSize: 18, weight: .semibold) title.font = UIFont.systemFont(ofSize: 18, weight: .semibold)
addSubview(title) addSubview(title)
let subtitle = UILabel() subtitle = UILabel()
subtitle.text = "Please wait on the screen. This might take several minutes." subtitle.text = "Please wait on the screen. This might take several minutes."
subtitle.textColor = .white subtitle.textColor = .white
subtitle.numberOfLines = 0 subtitle.numberOfLines = 0
...@@ -89,4 +99,10 @@ class PMLoadingView: UIView { ...@@ -89,4 +99,10 @@ class PMLoadingView: UIView {
}() }()
func setTitleaAndSubTitle(title:String,subTitle:String){
self.title.text = title
self.subtitle.text = subTitle
}
} }
//
// PMPermissionView.swift
// PhoneManager
//
// Created by edy on 2025/4/29.
//
import UIKit
class PMPermissionView: UIView {
override func awakeFromNib() {
super.awakeFromNib()
}
@IBAction func goSetting(_ sender: Any) {
// 跳转到系统设置的相册权限设置页面
if let settingsUrl = URL(string: UIApplication.openSettingsURLString) {
if UIApplication.shared.canOpenURL(settingsUrl) {
UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
print("跳转设置页面: \(success)")
})
}
}
}
}
<?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"/>
<view contentMode="scaleToFill" id="EwM-B0-fXo" customClass="PMPermissionView" customModule="PhoneManager" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="529" height="489"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_queshengtu" translatesAutoresizingMaskIntoConstraints="NO" id="qhV-IF-vsx">
<rect key="frame" x="170" y="100" width="189" height="189"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Access permission is required to start scan" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ci8-h6-fiE">
<rect key="frame" x="22" y="297" width="485" height="20"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</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="e8v-Xy-wvP">
<rect key="frame" x="24" y="320" width="480" height="38.333333333333314"/>
<string key="text">Phone Manager We need access to all the photos
in your photo library</string>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fRi-wi-J8I">
<rect key="frame" x="170" y="371.33333333333331" width="189" height="46"/>
<color key="backgroundColor" red="0.0" green="0.50980392159999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="46" id="2ml-bk-VZ7"/>
<constraint firstAttribute="width" constant="189" id="5L8-3e-E4p"/>
</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="Go to Settings"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="Radius">
<real key="value" value="23"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="goSetting:" destination="EwM-B0-fXo" eventType="touchUpInside" id="1Q0-Re-BL9"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="Z86-W8-437"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="fRi-wi-J8I" firstAttribute="centerX" secondItem="qhV-IF-vsx" secondAttribute="centerX" id="06a-VZ-yHW"/>
<constraint firstItem="ci8-h6-fiE" firstAttribute="leading" secondItem="Z86-W8-437" secondAttribute="leading" constant="22" id="2pS-Hl-sgb"/>
<constraint firstItem="ci8-h6-fiE" firstAttribute="centerX" secondItem="qhV-IF-vsx" secondAttribute="centerX" id="Fv3-iO-5BI"/>
<constraint firstItem="e8v-Xy-wvP" firstAttribute="leading" secondItem="Z86-W8-437" secondAttribute="leading" constant="24" id="Ygj-Ix-aYR"/>
<constraint firstItem="qhV-IF-vsx" firstAttribute="top" secondItem="EwM-B0-fXo" secondAttribute="top" constant="100" id="fx5-wC-f0q"/>
<constraint firstItem="fRi-wi-J8I" firstAttribute="top" secondItem="e8v-Xy-wvP" secondAttribute="bottom" constant="13" id="jys-rP-uUI"/>
<constraint firstItem="Z86-W8-437" firstAttribute="trailing" secondItem="e8v-Xy-wvP" secondAttribute="trailing" constant="25" id="p6c-uL-oEh"/>
<constraint firstItem="e8v-Xy-wvP" firstAttribute="top" secondItem="ci8-h6-fiE" secondAttribute="bottom" constant="3" id="tgi-kq-3Ap"/>
<constraint firstItem="ci8-h6-fiE" firstAttribute="top" secondItem="qhV-IF-vsx" secondAttribute="bottom" constant="8" id="uKW-kw-KCJ"/>
<constraint firstItem="Z86-W8-437" firstAttribute="trailing" secondItem="ci8-h6-fiE" secondAttribute="trailing" constant="22" id="wMs-cZ-eGL"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="284.73282442748092" y="-315.14084507042253"/>
</view>
</objects>
<resources>
<image name="icon_queshengtu" width="189" height="189"/>
</resources>
</document>
...@@ -18,12 +18,13 @@ class TipsDuplicatesSimilarController: UIViewController { ...@@ -18,12 +18,13 @@ class TipsDuplicatesSimilarController: UIViewController {
@IBOutlet weak var mainTitle: UILabel! @IBOutlet weak var mainTitle: UILabel!
@IBOutlet weak var subTitle: UILabel! @IBOutlet weak var subTitle: UILabel!
@IBOutlet weak var bottomC: ScreenHeightRatioConstraint!
var type:GuideTipsType = .duplicates var type:GuideTipsType = .duplicates
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
startBtn.layer.cornerRadius = 23.RH() 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)
...@@ -31,6 +32,8 @@ class TipsDuplicatesSimilarController: UIViewController { ...@@ -31,6 +32,8 @@ class TipsDuplicatesSimilarController: UIViewController {
mainTitle.text = type.title mainTitle.text = type.title
subTitle.text = type.text subTitle.text = type.text
bottomC.constant = kSafeAreaInsets.bottom == 0 ? 30 : 0
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TipsDuplicatesSimilarController" customModule="PhoneManager" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TipsDuplicatesSimilarController" customModule="PhoneManager" customModuleProvider="target">
<connections> <connections>
<outlet property="bottomC" destination="dX6-cv-Gto" id="3Ws-Iq-33S"/>
<outlet property="iconOne" destination="5sP-3G-R5V" id="ypq-LB-87o"/> <outlet property="iconOne" destination="5sP-3G-R5V" id="ypq-LB-87o"/>
<outlet property="iconTwo" destination="LIQ-mA-CKi" id="Uzy-Sr-7tG"/> <outlet property="iconTwo" destination="LIQ-mA-CKi" id="Uzy-Sr-7tG"/>
<outlet property="lineText" destination="XMa-dY-JFG" id="WBd-Yf-wR9"/> <outlet property="lineText" destination="XMa-dY-JFG" id="WBd-Yf-wR9"/>
...@@ -57,10 +58,10 @@ ...@@ -57,10 +58,10 @@
<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="846" width="410" height="46"/> <rect key="frame" x="15" y="876" width="410" 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" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/> <constraint firstAttribute="height" constant="46" id="DDB-jE-Azu"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
<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 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="fnl-2z-Ty3" firstAttribute="bottom" secondItem="XPg-Ph-1k0" secondAttribute="bottom" 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" 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" 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"/>
......
...@@ -9,11 +9,12 @@ import UIKit ...@@ -9,11 +9,12 @@ import UIKit
class TipsScreenShotController: UIViewController { class TipsScreenShotController: UIViewController {
@IBOutlet weak var bottomC: NSLayoutConstraint!
@IBOutlet weak var startBtn: UIButton! @IBOutlet weak var startBtn: UIButton!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
bottomC.constant = kSafeAreaInsets.bottom == 0 ? 30 : 0
startBtn.layer.cornerRadius = 23.RH() startBtn.layer.cornerRadius = 23
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TipsScreenShotController" customModule="PhoneManager" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TipsScreenShotController" customModule="PhoneManager" customModuleProvider="target">
<connections> <connections>
<outlet property="bottomC" destination="NWj-ld-9UY" id="vpf-nx-pUQ"/>
<outlet property="startBtn" destination="ybT-3z-Wb2" id="Gl8-Ue-VUX"/> <outlet property="startBtn" destination="ybT-3z-Wb2" id="Gl8-Ue-VUX"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
...@@ -28,10 +29,10 @@ ...@@ -28,10 +29,10 @@
</constraints> </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="852" width="400" height="46"/>
<color key="backgroundColor" red="0.0" green="0.50980392159999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.50980392159999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="46" id="4Qc-vw-6p8" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/> <constraint firstAttribute="height" constant="46" id="4Qc-vw-6p8"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
...@@ -61,7 +62,7 @@ ...@@ -61,7 +62,7 @@
<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="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="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" 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"/>
......
...@@ -14,18 +14,20 @@ class TipsVideoPhotoController: UIViewController { ...@@ -14,18 +14,20 @@ class TipsVideoPhotoController: UIViewController {
@IBOutlet weak var icon: UIImageView! @IBOutlet weak var icon: UIImageView!
@IBOutlet weak var subtitle: UILabel! @IBOutlet weak var subtitle: UILabel!
@IBOutlet weak var bottomC: NSLayoutConstraint!
var type:GuideTipsType = .duplicates var type:GuideTipsType = .duplicates
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
startBtn.layer.cornerRadius = 23.RH() startBtn.layer.cornerRadius = 23
icon.image = UIImage.init(named: type.tipOneIcon) icon.image = UIImage.init(named: type.tipOneIcon)
mainTitle.text = type.title mainTitle.text = type.title
subtitle.text = type.text subtitle.text = type.text
bottomC.constant = kSafeAreaInsets.bottom == 0 ? 30 : 0
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TipsVideoPhotoController" customModule="PhoneManager" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TipsVideoPhotoController" customModule="PhoneManager" customModuleProvider="target">
<connections> <connections>
<outlet property="bottomC" destination="SCz-tZ-pgH" id="Y5K-9r-aX4"/>
<outlet property="icon" destination="OpM-5k-AoO" id="Y63-tI-7xy"/> <outlet property="icon" destination="OpM-5k-AoO" id="Y63-tI-7xy"/>
<outlet property="mainTitle" destination="dcU-ld-SUp" id="ngg-L4-U4l"/> <outlet property="mainTitle" destination="dcU-ld-SUp" id="ngg-L4-U4l"/>
<outlet property="startBtn" destination="KHL-A7-P8d" id="qKH-gd-iBZ"/> <outlet property="startBtn" destination="KHL-A7-P8d" id="qKH-gd-iBZ"/>
...@@ -39,10 +40,10 @@ ...@@ -39,10 +40,10 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KHL-A7-P8d"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KHL-A7-P8d">
<rect key="frame" x="15" y="742" width="363" height="46"/> <rect key="frame" x="15" y="772" width="363" height="46"/>
<color key="backgroundColor" red="0.0" green="0.50980392159999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.50980392159999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="46" id="bCa-jh-IT1" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/> <constraint firstAttribute="height" constant="46" id="bCa-jh-IT1"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
...@@ -60,7 +61,7 @@ ...@@ -60,7 +61,7 @@
<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" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/> <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" 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" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/> <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"/>
......
...@@ -382,7 +382,6 @@ class PhotoSimilarityFinder { ...@@ -382,7 +382,6 @@ class PhotoSimilarityFinder {
filteredGroups.append(currentGroup) filteredGroups.append(currentGroup)
groupsLock.unlock() groupsLock.unlock()
} }
group.leave() group.leave()
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// //
import Foundation import Foundation
import UIKit
struct APPConfig{ struct APPConfig{
static let APPID = "1530333201" static let APPID = "1530333201"
...@@ -16,3 +16,12 @@ func KEYWINDOW() ->UIWindow?{ ...@@ -16,3 +16,12 @@ func KEYWINDOW() ->UIWindow?{
return UIApplication.shared.windows.first{$0.isKeyWindow} return UIApplication.shared.windows.first{$0.isKeyWindow}
} }
func DismissPresen(){
DispatchQueue.main.async{
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let topController = windowScene.windows.first?.rootViewController?.presentedViewController {
topController.dismiss(animated: true, completion: nil)
}
}
}
...@@ -224,5 +224,9 @@ ...@@ -224,5 +224,9 @@
<string>3qcr597p9d.skadnetwork</string> <string>3qcr597p9d.skadnetwork</string>
</dict> </dict>
</array> </array>
<key>UIBackgroundModes</key>
<array>
<string>processing</string>
</array>
</dict> </dict>
</plist> </plist>
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