Skip to content

Commit

Permalink
feat: able to run FioriSwiftUI natively on visionOS SDK (4)
Browse files Browse the repository at this point in the history
making sure that package and its unit test compile on visionOS
with Xcode 15.1 beta 2
  • Loading branch information
MarcoEidinger committed Nov 7, 2023
1 parent 391c274 commit 1c65609
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sources/FioriSwiftUICore/DataTable/InlineEditingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ struct InlineEditingView: View {
self._editingText = State(initialValue: dataItem?.text ?? "")
self._isValid = State(initialValue: (dataItem?.isValid ?? true, ""))
}

var toolbarItemPlacement: ToolbarItemPlacement {
#if os(visionOS)
return .automatic
#else
return .keyboard
#endif
}

var body: some View {
let dataItem = self.layoutData.allDataItems[self.rowIndex][self.columnIndex]
Expand Down Expand Up @@ -109,7 +117,7 @@ struct InlineEditingView: View {
.frame(width: cellWidth, height: cellHeight)
.border(isValid.0 ? Color.preferredColor(.tintColor) : Color.preferredColor(.negativeLabel), width: 2)
.toolbar {
ToolbarItemGroup(placement: .keyboard) {
ToolbarItemGroup(placement: toolbarItemPlacement) {
Spacer()

Button {
Expand Down

0 comments on commit 1c65609

Please sign in to comment.