Skip to content

Commit acfe377

Browse files
committed
Merge branch 'main' into fix/drag-image
2 parents 350dffc + 02202a8 commit acfe377

36 files changed

+1878
-205
lines changed

.github/scripts/tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ export LC_CTYPE=en_US.UTF-8
1616
set -o pipefail && arch -"${ARCH}" xcodebuild \
1717
-scheme CodeEditTextView \
1818
-derivedDataPath ".build" \
19-
-destination "platform=macos,arch=${ARCH}" \
19+
-destination "platform=macOS,arch=${ARCH},name=My Mac" \
2020
-skipPackagePluginValidation \
2121
clean test | xcpretty

Example/CodeEditTextViewExample/CodeEditTextViewExample.xcodeproj/project.pbxproj

Lines changed: 408 additions & 0 deletions
Large diffs are not rendered by default.

Example/CodeEditTextViewExample/CodeEditTextViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/CodeEditTextViewExample/CodeEditTextViewExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
},
8+
{
9+
"appearances" : [
10+
{
11+
"appearance" : "luminosity",
12+
"value" : "dark"
13+
}
14+
],
15+
"idiom" : "universal",
16+
"platform" : "ios",
17+
"size" : "1024x1024"
18+
},
19+
{
20+
"appearances" : [
21+
{
22+
"appearance" : "luminosity",
23+
"value" : "tinted"
24+
}
25+
],
26+
"idiom" : "universal",
27+
"platform" : "ios",
28+
"size" : "1024x1024"
29+
}
30+
],
31+
"info" : {
32+
"author" : "xcode",
33+
"version" : 1
34+
}
35+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.files.user-selected.read-write</key>
8+
<true/>
9+
</dict>
10+
</plist>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// CodeEditTextViewExampleApp.swift
3+
// CodeEditTextViewExample
4+
//
5+
// Created by Khan Winter on 1/9/25.
6+
//
7+
8+
import SwiftUI
9+
10+
@main
11+
struct CodeEditTextViewExampleApp: App {
12+
var body: some Scene {
13+
DocumentGroup(newDocument: CodeEditTextViewExampleDocument()) { file in
14+
ContentView(document: file.$document)
15+
}
16+
}
17+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// CodeEditTextViewExampleDocument.swift
3+
// CodeEditTextViewExample
4+
//
5+
// Created by Khan Winter on 1/9/25.
6+
//
7+
8+
import SwiftUI
9+
import UniformTypeIdentifiers
10+
11+
struct CodeEditTextViewExampleDocument: FileDocument {
12+
var text: String
13+
14+
init(text: String = "") {
15+
self.text = text
16+
}
17+
18+
static var readableContentTypes: [UTType] {
19+
[
20+
.item
21+
]
22+
}
23+
24+
init(configuration: ReadConfiguration) throws {
25+
guard let data = configuration.file.regularFileContents else {
26+
throw CocoaError(.fileReadCorruptFile)
27+
}
28+
text = String(bytes: data, encoding: .utf8)
29+
}
30+
31+
func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper {
32+
let data = Data(text.utf8)
33+
return .init(regularFileWithContents: data)
34+
}
35+
}

0 commit comments

Comments
 (0)