Commit 0d78e6da authored by yqz's avatar yqz

设置 项目修改

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