aboutsummaryrefslogtreecommitdiff
path: root/Map/Data/MapDocument.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Map/Data/MapDocument.swift')
-rw-r--r--Map/Data/MapDocument.swift18
1 files changed, 15 insertions, 3 deletions
diff --git a/Map/Data/MapDocument.swift b/Map/Data/MapDocument.swift
index 1b43efb..3c6d352 100644
--- a/Map/Data/MapDocument.swift
+++ b/Map/Data/MapDocument.swift
@@ -16,7 +16,7 @@ import SwiftUI
import UniformTypeIdentifiers
extension UTType {
- static var exampleText: UTType {
+ static var wmap: UTType {
UTType(importedAs: "systems.tranquil.map.wmap")
}
}
@@ -24,11 +24,23 @@ extension UTType {
struct MapDocument: FileDocument {
var text: String
- init(text: String = "Hello, world!") {
+ init(
+ text: String = """
+ Anchor (60, 5) [x]
+ Node A (78, 23)
+ Node B (40, 30) [square]
+ Node C (65, 70)
+
+ Anchor -> Node A
+ Anchor -> Node B
+ Node A -> Node C
+ Node B -> Node C
+ """
+ ) {
self.text = text
}
- static var readableContentTypes: [UTType] { [.exampleText] }
+ static var readableContentTypes: [UTType] { [.wmap] }
init(configuration: ReadConfiguration) throws {
guard let data = configuration.file.regularFileContents,