Commit e920cc85 authored by shenyong's avatar shenyong

2.2.3线上版本

parent 83205cfa
...@@ -526,14 +526,10 @@ ...@@ -526,14 +526,10 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources.sh\"\n";
...@@ -547,14 +543,10 @@ ...@@ -547,14 +543,10 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks.sh\"\n";
...@@ -816,7 +808,7 @@ ...@@ -816,7 +808,7 @@
CODE_SIGN_ENTITLEMENTS = PhoneManager/PhoneManager.entitlements; CODE_SIGN_ENTITLEMENTS = PhoneManager/PhoneManager.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6K23946NQ5; DEVELOPMENT_TEAM = 6K23946NQ5;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PhoneManager/Info.plist; INFOPLIST_FILE = PhoneManager/Info.plist;
...@@ -838,7 +830,7 @@ ...@@ -838,7 +830,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.2.2; MARKETING_VERSION = 2.2.3;
PRODUCT_BUNDLE_IDENTIFIER = com.app.phonemanager; PRODUCT_BUNDLE_IDENTIFIER = com.app.phonemanager;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
...@@ -864,7 +856,7 @@ ...@@ -864,7 +856,7 @@
CODE_SIGN_ENTITLEMENTS = PhoneManager/PhoneManager.entitlements; CODE_SIGN_ENTITLEMENTS = PhoneManager/PhoneManager.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6K23946NQ5; DEVELOPMENT_TEAM = 6K23946NQ5;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PhoneManager/Info.plist; INFOPLIST_FILE = PhoneManager/Info.plist;
...@@ -886,7 +878,7 @@ ...@@ -886,7 +878,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.2.2; MARKETING_VERSION = 2.2.3;
PRODUCT_BUNDLE_IDENTIFIER = com.app.phonemanager; PRODUCT_BUNDLE_IDENTIFIER = com.app.phonemanager;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
...@@ -1086,7 +1078,7 @@ ...@@ -1086,7 +1078,7 @@
repositoryURL = "https://github.com/firebase/firebase-ios-sdk"; repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = { requirement = {
kind = upToNextMajorVersion; kind = upToNextMajorVersion;
minimumVersion = 11.13.0; minimumVersion = 11.14.0;
}; };
}; };
04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */ = { 04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */ = {
......
...@@ -33,8 +33,17 @@ ...@@ -33,8 +33,17 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk", "location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : { "state" : {
"revision" : "3663b1aa6c7a1bed67ee80fd09dc6d0f9c3bb660", "revision" : "45d327fcbe7793747295346c2209ad419bdead74",
"version" : "11.13.0" "version" : "11.14.0"
}
},
{
"identity" : "google-ads-on-device-conversion-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk",
"state" : {
"revision" : "70a7857886f065a40486a7607268781c49db04ae",
"version" : "2.0.0"
} }
}, },
{ {
...@@ -42,8 +51,8 @@ ...@@ -42,8 +51,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git", "location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : { "state" : {
"revision" : "543071966b3fb6613a2fc5c6e7112d1e998184a7", "revision" : "406f72d0d5e9445fd1cf782db3e9e338cee2bed4",
"version" : "11.13.0" "version" : "11.14.0"
} }
}, },
{ {
......
...@@ -20,6 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -20,6 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UIViewController.swizzleViewDidAppear()
setupDefault() setupDefault()
window = UIWindow(frame: UIScreen.main.bounds) window = UIWindow(frame: UIScreen.main.bounds)
......
...@@ -12,6 +12,8 @@ import AdSupport ...@@ -12,6 +12,8 @@ import AdSupport
import AppLovinSDK import AppLovinSDK
import FBAudienceNetwork import FBAudienceNetwork
import SVProgressHUD import SVProgressHUD
import IronSource
import UnityAds
class ADManager : NSObject, FullScreenContentDelegate { class ADManager : NSObject, FullScreenContentDelegate {
...@@ -53,34 +55,35 @@ class ADManager : NSObject, FullScreenContentDelegate { ...@@ -53,34 +55,35 @@ class ADManager : NSObject, FullScreenContentDelegate {
/// 记录插屏上次展示广告的时间 /// 记录插屏上次展示广告的时间
private var interstitiallastAdShowTime: Date? private var interstitiallastAdShowTime: Date?
private var currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.2.2" private var currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.2.3"
var onlineVersion = "2.2.2" var onlineVersion = "2.2.3"
/// 默认每日免费删除次数 /// 默认每日免费删除次数
var defaultFreeTimes : Int { var defaultFreeTimes : Int {
get { get {
// 获取存储的时间 // 获取存储的时间
let saveTime = UserDefaults.standard.object(forKey: "saveTime") if let saveTime = UserDefaults.standard.object(forKey: "saveTime") as? Date{
if saveTime == nil {
UserDefaults.standard.set(Date(), forKey: "saveTime")
UserDefaults.standard.set(ADManager.shared.currentTimes, forKey: "saveAdvTimes")
return ADManager.shared.currentTimes
}else {
// 判断时间是不是同一天 // 判断时间是不是同一天
let calendar = Calendar.current let calendar = Calendar.current
let isSameDay = calendar.isDate(saveTime as! Date, inSameDayAs: Date()) let isSameDay = calendar.isDate(saveTime, inSameDayAs: Date())
if isSameDay { if isSameDay {
// 如果是同一天 // 如果是同一天
let times = UserDefaults.standard.object(forKey: "saveAdvTimes") as! Int if let times = UserDefaults.standard.object(forKey: "saveAdvTimes") as? Int{
// 如果等于0 那啥也不做
return times return times
}
// 如果等于0 那啥也不做
return 0
}else{ }else{
// 如果不是同一天,重置次数 // 如果不是同一天,重置次数
UserDefaults.standard.set(Date(), forKey: "saveTime") UserDefaults.standard.set(Date(), forKey: "saveTime")
UserDefaults.standard.set(ADManager.shared.currentTimes, forKey: "saveAdvTimes") UserDefaults.standard.set(ADManager.shared.currentTimes, forKey: "saveAdvTimes")
return ADManager.shared.currentTimes return ADManager.shared.currentTimes
} }
}else{
UserDefaults.standard.set(Date(), forKey: "saveTime")
UserDefaults.standard.set(ADManager.shared.currentTimes, forKey: "saveAdvTimes")
return ADManager.shared.currentTimes
} }
} }
} }
...@@ -105,8 +108,15 @@ class ADManager : NSObject, FullScreenContentDelegate { ...@@ -105,8 +108,15 @@ class ADManager : NSObject, FullScreenContentDelegate {
/// 初始化SDK /// 初始化SDK
func initAdertisementSDK() { func initAdertisementSDK() {
getADConfig()
ALPrivacySettings.setDoNotSell(true) ALPrivacySettings.setDoNotSell(true)
LevelPlay.setConsent(true)
LevelPlay.setMetaDataWithKey("do_not_sell", value: "YES")
FBAdSettings.setAdvertiserTrackingEnabled(true) FBAdSettings.setAdvertiserTrackingEnabled(true)
let gdprMetaData = UADSMetaData()
gdprMetaData.set("gdpr.consent", value: true)
gdprMetaData.commit()
MobileAds.shared.start { status in MobileAds.shared.start { status in
let adapterStatuses = status.adapterStatusesByClassName let adapterStatuses = status.adapterStatusesByClassName
for adapter in adapterStatuses { for adapter in adapterStatuses {
...@@ -624,7 +634,7 @@ extension ADManager{ ...@@ -624,7 +634,7 @@ extension ADManager{
} }
func dealVersionShowAD() -> Bool { func dealVersionShowAD() -> Bool {
let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.2.2" let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.2.3"
// 将版本号按点号分割成数组 // 将版本号按点号分割成数组
let currentComponents = currentVersion.components(separatedBy: ".") let currentComponents = currentVersion.components(separatedBy: ".")
......
...@@ -133,6 +133,8 @@ enum APIReportEnum{ ...@@ -133,6 +133,8 @@ enum APIReportEnum{
case EmailCleaner_show case EmailCleaner_show
case Contacts_show case Contacts_show
case page_show(String) // 页面展示上报枚举
} }
extension APIReportEnum{ extension APIReportEnum{
...@@ -174,8 +176,30 @@ extension APIReportEnum{ ...@@ -174,8 +176,30 @@ extension APIReportEnum{
case .Compress_show: return "Compress_show" case .Compress_show: return "Compress_show"
case .EmailCleaner_show: return "EmailCleaner_show" case .EmailCleaner_show: return "EmailCleaner_show"
case .Contacts_show: return "Contacts_show" case .Contacts_show: return "Contacts_show"
case .page_show(let className):
return "page_show_\(className)" // 页面展示上报枚举,使用类名作为标识
} }
} }
} }
extension UIViewController {
static func swizzleViewDidAppear() {
guard let originalMethod = class_getInstanceMethod(UIViewController.self, #selector(viewDidAppear(_:))),
let swizzledMethod = class_getInstanceMethod(UIViewController.self, #selector(swizzled_viewDidAppear(_:))) else { return }
method_exchangeImplementations(originalMethod, swizzledMethod)
}
@objc func swizzled_viewDidAppear(_ animated: Bool) {
// Call the original viewDidAppear
swizzled_viewDidAppear(animated)
// Report class name
reportPageAppear(className: String(describing: type(of: self)))
}
func reportPageAppear(className: String) {
// Your reporting logic here
print("Page appeared: \(className)")
APIReportManager.shared.startReport(type: .page_show(className))
}
}
...@@ -795,11 +795,14 @@ extension PhotoManager{ ...@@ -795,11 +795,14 @@ extension PhotoManager{
return assets.filter { !identifierSet.contains($0.localIdentifier) } return assets.filter { !identifierSet.contains($0.localIdentifier) }
} }
/// 过滤分组中的资源
func filterGroups(_ groups: [[AssetModel]], byExcludingIDs ids: [String]) -> [[AssetModel]] { func filterGroups(_ groups: [[AssetModel]], byExcludingIDs ids: [String]) -> [[AssetModel]] {
let excludeSet = Set(ids) let excludeSet = Set(ids)
return groups.filter { group in return groups.compactMap { group in
// 检查子数组中是否所有元素的ID都不在排除列表中 // 过滤掉需要排除的元素
group.allSatisfy { !excludeSet.contains($0.localIdentifier) } let filteredGroup = group.filter { !excludeSet.contains($0.localIdentifier) }
// 仅当过滤后的组至少包含2个元素时保留
return filteredGroup.count >= 2 ? filteredGroup : nil
} }
} }
......
...@@ -101,25 +101,21 @@ extension ContactViewController{ ...@@ -101,25 +101,21 @@ extension ContactViewController{
/// 初始化联系人数据 /// 初始化联系人数据
func initContatsInfo() { func initContatsInfo() {
DispatchQueue.global(qos: .userInitiated).async {
let store = CNContactStore() let store = CNContactStore()
let keysToFetch = [ let keysToFetch = [
CNContactGivenNameKey as CNKeyDescriptor, CNContactGivenNameKey as CNKeyDescriptor,
CNContactFamilyNameKey as CNKeyDescriptor, CNContactFamilyNameKey as CNKeyDescriptor,
CNContactPhoneNumbersKey as CNKeyDescriptor CNContactPhoneNumbersKey as CNKeyDescriptor
] ]
do { do {
let request = CNContactFetchRequest(keysToFetch: keysToFetch) let request = CNContactFetchRequest(keysToFetch: keysToFetch)
// 创建数组 var incompleteContacts: [ContactModel] = []
var incompleteContacts : [ContactModel] = [] var allContacts: [ContactModel] = []
var allContacts : [ContactModel] = [] var duplicates: [[ContactModel]] = []
var duplicates : [[ContactModel]] = []
var contactsByName: [String: [ContactModel]] = [:] var contactsByName: [String: [ContactModel]] = [:]
try store.enumerateContacts(with: request) { contact, stop in try store.enumerateContacts(with: request) { contact, stop in
if let model = ContactModel.init(contact: contact) { if let model = ContactModel.init(contact: contact) {
if model.fullName.isEmpty || model.phoneNumber?.count ?? 0 <= 0 { if model.fullName.isEmpty || model.phoneNumber?.count ?? 0 <= 0 {
incompleteContacts.append(model) incompleteContacts.append(model)
} }
...@@ -133,10 +129,15 @@ extension ContactViewController{ ...@@ -133,10 +129,15 @@ extension ContactViewController{
} }
duplicates = contactsByName.values.filter { $0.count > 1 } duplicates = contactsByName.values.filter { $0.count > 1 }
} }
} }
self.dataSourceModel = ContactModuleModel.init(duplicates: sortDupDataSource(orgData: duplicates), incompleteContacts: incompleteContacts, backups: [], allContacts: allContacts) let dataSource = ContactModuleModel.init(
duplicates: self.sortDupDataSource(orgData: duplicates),
incompleteContacts: incompleteContacts,
backups: [],
allContacts: allContacts
)
DispatchQueue.main.async { DispatchQueue.main.async {
self.dataSourceModel = dataSource
self.updateModuleData() self.updateModuleData()
self.moduleView.tableView.reloadData() self.moduleView.tableView.reloadData()
} }
...@@ -145,8 +146,6 @@ extension ContactViewController{ ...@@ -145,8 +146,6 @@ extension ContactViewController{
print("获取联系人信息时发生错误: \(error)") print("获取联系人信息时发生错误: \(error)")
} }
} }
// 获取备份数据 // 获取备份数据
let vm = BackupViewModel() let vm = BackupViewModel()
vm.retrieveContactsFromBackup { model, error in vm.retrieveContactsFromBackup { model, error in
...@@ -161,6 +160,7 @@ extension ContactViewController{ ...@@ -161,6 +160,7 @@ extension ContactViewController{
} }
} }
} }
}
// MARK: 辅助方法 // MARK: 辅助方法
......
...@@ -821,13 +821,14 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti ...@@ -821,13 +821,14 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
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")
} }
} }
}
// 删除成功页面 // 删除成功页面
func showDeleteSuccess(fileCount:Int,fileSize:Int64){ func showDeleteSuccess(fileCount:Int,fileSize:Int64){
......
...@@ -672,13 +672,14 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie ...@@ -672,13 +672,14 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
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")
} }
} }
}
/// 弹出广告 /// 弹出广告
func popAdverTisement(){ func popAdverTisement(){
......
...@@ -302,11 +302,12 @@ extension TrashSubView { ...@@ -302,11 +302,12 @@ extension TrashSubView {
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")
} }
} }
}
} }
...@@ -99,7 +99,9 @@ class PMShowImgVideoController: BaseViewController { ...@@ -99,7 +99,9 @@ class PMShowImgVideoController: BaseViewController {
make.bottom.equalToSuperview().offset(-(cWindow?.safeAreaInsets.bottom ?? 0)) make.bottom.equalToSuperview().offset(-(cWindow?.safeAreaInsets.bottom ?? 0))
} }
self.view.layoutIfNeeded() self.view.layoutIfNeeded()
if currentIdx < imageVideoPath.count {
self.MaxCollection.scrollToItem(at: IndexPath(row: currentIdx, section: 0), at: .centeredHorizontally, animated: false) self.MaxCollection.scrollToItem(at: IndexPath(row: currentIdx, section: 0), at: .centeredHorizontally, animated: false)
}
changeNavInfo() changeNavInfo()
backView.setShadow(cornerRadius: 0, sColor: UIColor.colorWithHex(hexStr: "#1475B9"), offset: CGSizeMake(3, -1),opacity: 0.15) backView.setShadow(cornerRadius: 0, sColor: UIColor.colorWithHex(hexStr: "#1475B9"), offset: CGSizeMake(3, -1),opacity: 0.15)
...@@ -278,8 +280,11 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa ...@@ -278,8 +280,11 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
collectionView.contentOffset = CGPointMake( idx * (68 + 10) , 0) collectionView.contentOffset = CGPointMake( idx * (68 + 10) , 0)
} }
self.currentIdx = Int(idx) self.currentIdx = Int(idx)
if Int(idx) < imageVideoPath.count {
MaxCollection.scrollToItem(at: IndexPath(row: Int(idx), section: 0), at: .centeredHorizontally, animated: true) MaxCollection.scrollToItem(at: IndexPath(row: Int(idx), section: 0), at: .centeredHorizontally, animated: true)
} }
}
} }
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
...@@ -296,7 +301,7 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa ...@@ -296,7 +301,7 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if collectionView == bottItems { if collectionView == bottItems {
if (indexPath.row > self.homeDataSource?.count ?? 0) { if indexPath.row > (self.homeDataSource?.count ?? 0) - 1 {
return return
} }
if state != .secret { if state != .secret {
...@@ -317,7 +322,7 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa ...@@ -317,7 +322,7 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
collectionView.reloadData() collectionView.reloadData()
}else{ }else{
self.currentIdx = indexPath.row; self.currentIdx = indexPath.row;
if indexPath.row >= imageVideoPath.count{ if indexPath.row < imageVideoPath.count{
self.MaxCollection.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true) self.MaxCollection.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
} }
} }
......
...@@ -346,13 +346,14 @@ extension TrashViewController:UIScrollViewDelegate{ ...@@ -346,13 +346,14 @@ extension TrashViewController:UIScrollViewDelegate{
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")
} }
} }
}
func showDeleteSuccess(array:[AssetModel]){ func showDeleteSuccess(array:[AssetModel]){
var tempSize = 0.0 var tempSize = 0.0
......
...@@ -23,6 +23,8 @@ target 'PhoneManager' do ...@@ -23,6 +23,8 @@ target 'PhoneManager' do
#广告适配器 #广告适配器
pod 'GoogleMobileAdsMediationAppLovin' pod 'GoogleMobileAdsMediationAppLovin'
pod 'GoogleMobileAdsMediationIronSource'
pod 'GoogleMobileAdsMediationUnity'
#pod 'GoogleMobileAdsMediationFacebook' #pod 'GoogleMobileAdsMediationFacebook'
post_install do |installer| post_install do |installer|
......
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