Commit 1a421bdd authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent 3f786966
......@@ -52,20 +52,12 @@ class SHRecordShowViewController: SHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
// AVAudioSession.sharedInstance().requestRecordPermission { (allowed) in
// if !allowed {
// return
// }
// }
// let session:AVAudioSession = AVAudioSession.sharedInstance()
// do {
// try session.setCategory(AVAudioSession.Category.playAndRecord, options: .defaultToSpeaker)
// }catch{
// print("session config failed")
// }
//
// do { try AVAudioSession.sharedInstance().setActive(true) }
// catch { print("session active failed") }
for path in model!.imagesPath{
let s = DocumentPath+path
if let image = UIImage.init(contentsOfFile: s){
}
}
setupUI()
play()
......
......@@ -152,15 +152,16 @@ class SHCloudManager: NSObject {
if index > recordModel.imagesPath.count-1 {
break
}
var path = recordModel.imagesPath[index]
path = DocumentPath+path
let path = recordModel.imagesPath[index]
var filePath = path.components(separatedBy: "/")[1]
filePath = DocumentPath+"/"+filePath
// if let image = UIImage.init(contentsOfFile: asset.fileURL!.path){
// recordModel.images.append(image)
// }
if FileManager.default.fileExists(atPath: path) == false {
if FileManager.default.fileExists(atPath: filePath) == false {
if let imageData = try? Data(contentsOf: asset.fileURL!){
try! FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: true, attributes: nil)
try? imageData.write(to: URL(fileURLWithPath: path))
try! FileManager.default.createDirectory(atPath: filePath, withIntermediateDirectories: true, attributes: nil)
try? imageData.write(to: URL(fileURLWithPath: DocumentPath+path))
}
}
}
......
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