|
|
@@ -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() { |
|
|
|