Skip to content

Commit 97e8871

Browse files
authored
Updated test platforms (#52)
* Updated test platforms * updated github actions and platforms
1 parent 7be885d commit 97e8871

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

.github/workflows/build.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ env:
1515

1616
jobs:
1717
build:
18-
runs-on: macos-13
18+
runs-on: macos-15
1919
steps:
2020
- uses: actions/checkout@v3
2121
- uses: maxim-lobanov/setup-xcode@v1
2222
with:
23-
xcode-version: '15.1.0'
24-
- name: Build iOS
25-
run: xcodebuild -scheme $SCHEME -derivedDataPath .build -destination 'generic/platform=iOS';
23+
xcode-version: '16.0'
24+
- name: Build all platforms
25+
run: bash scripts/build.sh ${{ github.event.repository.name }}
2626
- name: Test iOS
27-
run: xcodebuild test -scheme $TEST_SCHEME -derivedDataPath .build -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' -enableCodeCoverage YES;
27+
run: bash scripts/test.sh ${{ github.event.repository.name }}

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let package = Package(
77
platforms: [
88
.iOS(.v15),
99
.macOS(.v12),
10-
.tvOS(.v15),
10+
.tvOS(.v17),
1111
.watchOS(.v8),
1212
.visionOS(.v1)
1313
],

RichEditorDemo/RichEditorDemo.xcodeproj/project.pbxproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@
305305
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
306306
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
307307
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
308-
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
308+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
309309
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
310310
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
311311
MACOSX_DEPLOYMENT_TARGET = 14.0;
@@ -319,6 +319,7 @@
319319
SWIFT_EMIT_LOC_STRINGS = YES;
320320
SWIFT_VERSION = 5.0;
321321
TARGETED_DEVICE_FAMILY = "1,2,3";
322+
TVOS_DEPLOYMENT_TARGET = 17.0;
322323
};
323324
name = Debug;
324325
};
@@ -343,7 +344,7 @@
343344
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
344345
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
345346
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
346-
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
347+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
347348
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
348349
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
349350
MACOSX_DEPLOYMENT_TARGET = 14.0;
@@ -357,6 +358,7 @@
357358
SWIFT_EMIT_LOC_STRINGS = YES;
358359
SWIFT_VERSION = 5.0;
359360
TARGETED_DEVICE_FAMILY = "1,2,3";
361+
TVOS_DEPLOYMENT_TARGET = 17.0;
360362
};
361363
name = Release;
362364
};

RichEditorDemo/RichEditorDemo/ContentView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct ContentView: View {
5252
}
5353
.background(colorScheme == .dark ? .black : .gray.opacity(0.07))
5454
.navigationTitle("Rich Editor")
55-
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
55+
#if os(iOS)
5656
.navigationBarTitleDisplayMode(.inline)
5757
#endif
5858
}

Sources/RichEditorSwiftUI/UI/Editor/RichEditor.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ public struct RichTextEditor: ViewRepresentable {
124124

125125
public func makeNSView(context: Context) -> some NSView {
126126
if self.context.internalSpans.isEmpty {
127-
textView.setup(with: self.context.attributedString)
127+
textView.setup()
128128
} else {
129-
textView.setup(with: self.context.internalSpans)
129+
textView.setup()
130130
}
131131
textView.configuration = config
132132
textView.theme = style

Sources/RichEditorSwiftUI/UI/EditorToolBar/EditorToolBarView.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ struct TitleStyleButton: View {
124124
.cornerRadius(5)
125125
.padding(.vertical, 5)
126126
})
127+
#if !os(tvOS)
127128
.onTapGesture {
128129
isExpanded.toggle()
129130
}
130-
131+
#endif
131132
}
133+
132134

133135
func hasStyle(_ style: TextSpanStyle) -> Bool {
134136
return appliedTools.contains(where: { $0.key == style.key })

Sources/RichEditorSwiftUI/UI/TextViewUI/RichTextView_AppKit.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import AppKit
2424
*/
2525
open class RichTextView: NSTextView, RichTextViewComponent {
2626

27+
2728
// MARK: - Properties
2829

2930
/// The configuration to use by the rich text view.
@@ -106,8 +107,8 @@ open class RichTextView: NSTextView, RichTextViewComponent {
106107
- text: The text to edit with the text view.
107108
- format: The rich text format to edit.
108109
*/
109-
open func setup(with text: NSAttributedString? = nil) {
110-
setupSharedBehavior(with: text)
110+
open func setup() {
111+
setupSharedBehavior()
111112
allowsImageEditing = true
112113
allowsUndo = true
113114
layoutManager?.defaultAttachmentScaling = NSImageScaling.scaleProportionallyDown

0 commit comments

Comments
 (0)