Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated test platforms #52

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ env:

jobs:
build:
runs-on: macos-13
runs-on: macos-15
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.1.0'
- name: Build iOS
run: xcodebuild -scheme $SCHEME -derivedDataPath .build -destination 'generic/platform=iOS';
xcode-version: '16.0'
- name: Build all platforms
run: bash scripts/build.sh ${{ github.event.repository.name }}
- name: Test iOS
run: xcodebuild test -scheme $TEST_SCHEME -derivedDataPath .build -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.2' -enableCodeCoverage YES;
run: bash scripts/test.sh ${{ github.event.repository.name }}
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let package = Package(
platforms: [
.iOS(.v15),
.macOS(.v12),
.tvOS(.v15),
.tvOS(.v17),
.watchOS(.v8),
.visionOS(.v1)
],
Expand Down
6 changes: 4 additions & 2 deletions RichEditorDemo/RichEditorDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -319,6 +319,7 @@
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 17.0;
};
name = Debug;
};
Expand All @@ -343,7 +344,7 @@
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -357,6 +358,7 @@
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 17.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion RichEditorDemo/RichEditorDemo/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct ContentView: View {
}
.background(colorScheme == .dark ? .black : .gray.opacity(0.07))
.navigationTitle("Rich Editor")
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/RichEditorSwiftUI/UI/Editor/RichEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public struct RichTextEditor: ViewRepresentable {

public func makeNSView(context: Context) -> some NSView {
if self.context.internalSpans.isEmpty {
textView.setup(with: self.context.attributedString)
textView.setup()
} else {
textView.setup(with: self.context.internalSpans)
textView.setup()
}
textView.configuration = config
textView.theme = style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ struct TitleStyleButton: View {
.cornerRadius(5)
.padding(.vertical, 5)
})
#if !os(tvOS)
.onTapGesture {
isExpanded.toggle()
}

#endif
}


func hasStyle(_ style: TextSpanStyle) -> Bool {
return appliedTools.contains(where: { $0.key == style.key })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import AppKit
*/
open class RichTextView: NSTextView, RichTextViewComponent {


// MARK: - Properties

/// The configuration to use by the rich text view.
Expand Down Expand Up @@ -106,8 +107,8 @@ open class RichTextView: NSTextView, RichTextViewComponent {
- text: The text to edit with the text view.
- format: The rich text format to edit.
*/
open func setup(with text: NSAttributedString? = nil) {
setupSharedBehavior(with: text)
open func setup() {
setupSharedBehavior()
allowsImageEditing = true
allowsUndo = true
layoutManager?.defaultAttachmentScaling = NSImageScaling.scaleProportionallyDown
Expand Down
Loading