7 let appDirectory: String = "captura"
9 private var baseURL: URL {
10 baseDirectory.appendingPathComponent("\(appDirectory)/\(name)")
14 return baseURL.appendingPathExtension("mp4")
18 return baseURL.appendingPathExtension("gif")
22 let dateFormatter = DateFormatter()
23 dateFormatter.dateStyle = .medium
24 dateFormatter.timeStyle = .medium
25 dateFormatter.locale = Locale.current
26 let dateString = dateFormatter.string(from: Date()).replacingOccurrences(of: ":", with: ".")
28 self.name = "Captura \(dateString)"
29 self.baseDirectory = FileManager.default.urls(for: .picturesDirectory, in: .userDomainMask).first!
30 try? FileManager.default.createDirectory(at: self.baseDirectory.appendingPathComponent(appDirectory),
31 withIntermediateDirectories: true,