Commit 0d78e6da authored by yqz's avatar yqz

设置 项目修改

parent 0386184f
...@@ -107,28 +107,34 @@ class SecretViewController: BaseViewController { ...@@ -107,28 +107,34 @@ class SecretViewController: BaseViewController {
} }
private func deleteData() -> Void { private func deleteData() -> Void {
var delName:[String] = [] var DelCallBlock = { [weak self] in
for idx in selectArray.allObjects { guard let self = self else { return }
guard let row:Int = idx as? Int else { return } var delName:[String] = []
let name = dataSource[row] for idx in self.selectArray.allObjects {
delName.append(name) guard let row:Int = idx as? Int else { return }
} let name = self.dataSource[row]
"".delPhotoVideo(delName) delName.append(name)
if selectArray.count > 0 { }
selectArray.removeAllObjects() "".delPhotoVideo(delName)
if self.selectArray.count > 0 {
self.selectArray.removeAllObjects()
}
Print("删除成功")
self.dataSource = self.loadData()
self.bottomm.state = .add
} }
Print("删除成功") PMAlert("These photos or videos will be deleted from your private space" , ["Cancel","Delete"] , { alert, selectidx in
dataSource = loadData() if selectidx == 1 {
bottomm.state = .add DelCallBlock()
}
alert.dismiss(animated: true)
})
} }
@objc private func lockTouch(_ sender:UIButton) -> Void { @objc private func lockTouch(_ sender:UIButton) -> Void {
if pass.count > 2 { if pass.count > 2 {
let set = SecretSetViewController() let set = SecretSetViewController()
set.secretType = .del set.secretType = .del
set.Callback = { bt in
}
self.navigationController?.pushViewController(set, animated: true) self.navigationController?.pushViewController(set, animated: true)
}else{ }else{
let set = SecretSetViewController() let set = SecretSetViewController()
......
...@@ -60,10 +60,10 @@ func getSettingViewInfo() -> [SettingModel] { ...@@ -60,10 +60,10 @@ func getSettingViewInfo() -> [SettingModel] {
[RowInfoModel(imageName: "ic_more_setting",title: "More Apps From Us")]), [RowInfoModel(imageName: "ic_more_setting",title: "More Apps From Us")]),
SettingModel(sectionTitle: "UTILITIES",rowInfo: SettingModel(sectionTitle: "UTILITIES",rowInfo:
[RowInfoModel(imageName: "ic_widgets_setting",title: "Widgets")]), [RowInfoModel(imageName: "ic_widgets_setting",title: "Widgets")]),
SettingModel(sectionTitle: "SECRET SPACE",rowInfo: [ // SettingModel(sectionTitle: "SECRET SPACE",rowInfo: [
RowInfoModel(imageName: "ic_pin_setting",title: "Use PIN")]), // RowInfoModel(imageName: "ic_pin_setting",title: "Use PIN")]),
SettingModel(sectionTitle: "STAY IN TOUCH",rowInfo: SettingModel(sectionTitle: "STAY IN TOUCH",rowInfo:
[RowInfoModel(imageName: "ic_rate_setting",title: "Rate App"), [RowInfoModel(imageName: "ic_rate_setting",title: "Rate App"),
RowInfoModel(imageName: "ic_share_setting",title: "Share App"), RowInfoModel(imageName: "ic_share_setting",title: "Share App"),
RowInfoModel(imageName: "ic_ins_setting",title: "Follow on Instagram")])] /*RowInfoModel(imageName: "ic_ins_setting",title: "Follow on Instagram")*/])]
} }
...@@ -62,7 +62,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -62,7 +62,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
let model : SettingModel = modelData![indexPath.section] let model : SettingModel = modelData![indexPath.section]
let detailModel : RowInfoModel = model.rowInfo[indexPath.row] let detailModel : RowInfoModel = model.rowInfo[indexPath.row]
if indexPath.section == 3 { if indexPath.section == 13 {
let cell : SettingSwitchCell = tableView.dequeueReusableCell(withIdentifier: "SettingSwitchCell",for: indexPath) as! SettingSwitchCell let cell : SettingSwitchCell = tableView.dequeueReusableCell(withIdentifier: "SettingSwitchCell",for: indexPath) as! SettingSwitchCell
cell.fLabel.text = detailModel.title cell.fLabel.text = detailModel.title
cell.logoView.image = UIImage(named: detailModel.imageName) cell.logoView.image = UIImage(named: detailModel.imageName)
...@@ -155,8 +155,6 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -155,8 +155,6 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
self.navigationController?.pushViewController(widget, animated: true) self.navigationController?.pushViewController(widget, animated: true)
break break
case 3: case 3:
break
case 4:
if indexPath.row == 0 { // 评分 if indexPath.row == 0 { // 评分
self.review() self.review()
}else if indexPath.row == 1 { // 分享 }else if indexPath.row == 1 { // 分享
......
...@@ -39,7 +39,7 @@ class WidgetViewController: BaseViewController { ...@@ -39,7 +39,7 @@ class WidgetViewController: BaseViewController {
var widgetIdx = 0 var widgetIdx = 0
widgetIdx = (widgets == .battery ? 0 : 1) * 10 + widgetMode widgetIdx = (widgets == .battery ? 0 : 1) * 10 + widgetMode
widgetAppgourp.share.PushWidgetData(widgetIdx, battery: Int(battery), storage: Int(storage)) widgetAppgourp.share.PushWidgetData(widgetIdx, battery: Int(battery), storage: Int(storage))
alert("Set Widget Successfully") PMAlert("Set Widget Successfully")
} }
func setUI() -> Void { func setUI() -> Void {
......
...@@ -808,7 +808,7 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro ...@@ -808,7 +808,7 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro
func cameraController(_ cameraController: HXPhotoPicker.CameraController, didFinishWithResult result: HXPhotoPicker.CameraController.Result, phAsset: PHAsset?, location: CLLocation?) { func cameraController(_ cameraController: HXPhotoPicker.CameraController, didFinishWithResult result: HXPhotoPicker.CameraController.Result, phAsset: PHAsset?, location: CLLocation?) {
switch result { switch result {
case .image(let image): case .image(let image):
image.compressImage(0.7) {[weak self] image in image.compressImage(0.3) {[weak self] image in
let data = image.pngData() let data = image.pngData()
guard self?.callback != nil else { return } guard self?.callback != nil else { return }
self?.callback!(0,data) self?.callback!(0,data)
......
...@@ -55,15 +55,27 @@ func weekFormatter() -> String { ...@@ -55,15 +55,27 @@ func weekFormatter() -> String {
} }
func alert(_ msg:String) -> Void { func PMAlert(_ msg:String , _ action:[String] = [] , _ complate:@escaping(( UIAlertController ,Int)->Void) = { v , idx in} ) -> Void {
let alertview = UIAlertController(title: nil, message: msg, preferredStyle: .alert) let alertview = UIAlertController(title: nil, message: msg, preferredStyle: .alert)
guard let root = cWindow?.rootViewController else { return } guard let root = cWindow?.rootViewController else { return }
root.present(alertview, animated: true) root.present(alertview, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { if action.count > 0 {
alertview.dismiss(animated: true) for (i,title) in action.enumerated() {
let action = UIAlertAction(title: title, style: .default) { action in
complate(alertview,i)
}
alertview.addAction(action)
}
}else{
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
alertview.dismiss(animated: true)
}
} }
} }
public func Print(_ items: Any...) { public func Print(_ items: Any...) {
#if DEBUG #if DEBUG
......
...@@ -108,7 +108,7 @@ extension String { ...@@ -108,7 +108,7 @@ extension String {
pv(-1,UIImage.Clear()) pv(-1,UIImage.Clear())
return return
} }
icon.resizeAndCompressImage().compressImage(0.3) { image in icon.compressImage(0.2) { image in
SecretImageCache.share.saveImageCache(self, image) SecretImageCache.share.saveImageCache(self, image)
pv(-1,image) pv(-1,image)
} }
...@@ -121,7 +121,7 @@ extension String { ...@@ -121,7 +121,7 @@ extension String {
do { do {
let cgImage = try imageGenerator.copyCGImage(at: CMTime(value: 0, timescale: 1), actualTime: nil) let cgImage = try imageGenerator.copyCGImage(at: CMTime(value: 0, timescale: 1), actualTime: nil)
let icon = UIImage(cgImage: cgImage); let icon = UIImage(cgImage: cgImage);
icon.resizeAndCompressImage(0.3).compressImage(0.3) { image in icon.compressImage(0.2) { image in
SecretImageCache.share.saveImageCache(self, image,CMTimeGetSeconds(duration)) SecretImageCache.share.saveImageCache(self, image,CMTimeGetSeconds(duration))
pv(CMTimeGetSeconds(duration) ,image) pv(CMTimeGetSeconds(duration) ,image)
} }
......
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