Commit 08513caa authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

cloud

parent 7a599916
......@@ -10,7 +10,7 @@ import UIKit
class SHRecordModel: NSObject{
@objc var recordType: NSInteger = 0
@objc var recordingType: NSInteger = 0
@objc var createDate: Date = Date()
@objc var modifyDate: Date = Date()
......
......@@ -68,7 +68,6 @@ class SHRecordDetailsVC: SHBaseViewController {
}
}
}
// currentModel.dataSources[index] = model
}
tableView?.reloadData()
break
......@@ -110,13 +109,25 @@ class SHRecordDetailsVC: SHBaseViewController {
}
}
@objc func editClick(){
@objc func editClick(_ restore:Bool){
if restore == false{
if currentModel.dataSources.count == 0 {
return
}
edit = !edit
}else {
edit = false
}
if edit {
for model in currentModel.dataSources{
model.selected = false
}
self.selectRecordModels = []
self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(title: "完成", style: .done, target: self, action: #selector(editClick))
UIView.animate(withDuration: 0.25) {
......@@ -128,11 +139,7 @@ class SHRecordDetailsVC: SHBaseViewController {
UIView.animate(withDuration: 0.25) {
self.bottomView?.frame = CGRect.init(x: -self.tableFooterView!.frame.width, y: 0, width: self.tableFooterView!.frame.width*2, height: self.tableFooterView!.frame.height)
}
for model in currentModel.dataSources{
model.selected = false
}
self.bottomView?.deleteSelected = false
}
self.navigationItem.rightBarButtonItem?.tintColor = UIColor.init(hexStr: "4183F4")
self.tableView?.reloadData()
......@@ -176,9 +183,11 @@ extension SHRecordDetailsVC {
for model in self.currentModel.dataSources {
model.selected = false
}
self.edit = false
self.selectRecordModels = []
DispatchQueue.main.async {
self.editClick(true)
self.updateocloudUI()
// self.tableView?.reloadData()
}
}
}
//MARK:icloud上传Models
......@@ -292,11 +301,7 @@ extension SHRecordDetailsVC {
// }
if currentModel.dataSources.count == 0 {
self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(title: "编辑", style: .done, target: self, action: #selector(editClick))
self.navigationItem.rightBarButtonItem?.tintColor = UIColor.init(hexStr: "4183F4")
UIView.animate(withDuration: 0.25) {
self.bottomView?.frame = CGRect.init(x: -self.tableFooterView!.frame.width, y: 0, width: self.tableFooterView!.frame.width*2, height: self.tableFooterView!.frame.height)
}
self.editClick(true)
self.markAlertViewShow(false)
bottomView?.cancel = true
}
......
......@@ -44,6 +44,12 @@ class SHRecordListViewController: SHBaseViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// prepareDateSource()
// self.tableView?.reloadData()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
prepareDateSource()
self.tableView?.reloadData()
}
......
......@@ -478,6 +478,7 @@ class SHRecordViewController: SHBaseViewController{
let nowDate = Date()
let model = SHRecordModel()
model.recordingType = 0
model.createDate = nowDate
model.modifyDate = nowDate
model.address = currentAddress ?? ""
......
......@@ -130,7 +130,7 @@ class SHCloudManager: NSObject {
if pathFile == record["pathFile"] {
contains = true
let recordModel = SHRecordModel()
recordModel.recordType = record["recordType"] as? NSInteger ?? 0
recordModel.recordingType = record["recordingType"] as? NSInteger ?? 0
recordModel.address = record["address"] as? String ?? ""
recordModel.pathFile = record["pathFile"] as? String ?? ""
recordModel.rename = record["title"] as? String ?? ""
......@@ -197,7 +197,7 @@ class SHCloudManager: NSObject {
let asset = CKAsset.init(fileURL: url)
let record = CKRecord.init(recordType: recordName)
record.setValue(recordModel.recordType, forKey: "recordType")
record.setValue(recordModel.recordingType, forKey: "recordingType")
record.setValue(recordModel.rename, forKey: "title")
record.setValue(recordModel.pathFile, forKey: "pathFile")
record.setValue(recordModel.address, forKey: "address")
......
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