Explorar el Código

Use draft.txt in ~/.writeas folder

master
Matt Baer hace 6 años
padre
commit
6ae9d434fa
Se han modificado 1 ficheros con 2 adiciones y 8 borrados
  1. +2
    -8
      writeas/ViewController.swift

+ 2
- 8
writeas/ViewController.swift Ver fichero

@@ -12,7 +12,7 @@ class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCe

@IBOutlet var writerText: NSTextView!

let draftFile = "Write.as/draft.txt"
let draftFile = "\(NSHomeDirectory())/.writeas/draft.txt"

override func viewDidLoad() {
super.viewDidLoad()
@@ -56,13 +56,7 @@ class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCe
}

fileprivate func getDraftPath() -> URL? {
do {
let baseDir = try FileManager.default.url(for: .documentDirectory, in: .allDomainsMask, appropriateFor: nil, create: true)
return baseDir.appendingPathComponent(draftFile)
} catch (let err) {
print("ERROR getting path: \(err)")
return nil
}
return URL(fileURLWithPath: draftFile)
}

func saveDocument() {


Cargando…
Cancelar
Guardar