Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
79 views

In SwiftUI, you can dynamically size a TextField like this which expands vertically as the user types. TextField("Enter text", text: $text, axis: .vertical) I would like to do the same thing ...
Berry Blue's user avatar
  • 16.9k
-3 votes
0 answers
49 views

I am using the new AttributedString in Swift 26 with a TextEditor in dark mode to track selections for a qualitative data analysis tool. ISSUE: In dark mode, the highlight colour inherited from system ...
Bhorda's user avatar
  • 15
0 votes
1 answer
54 views

I am trying to build a very simple text editor with SwiftUI for iOS and macOS 26. Like with any editor I would expect to only change the bold attribute when pressing the bold button. It seems like ...
viedev's user avatar
  • 1,663
1 vote
1 answer
307 views

I'm building a SwiftUI demo where I have a list of editable text fields using TextEditor inside a ScrollView. Each field is dynamically created and uses a custom MultilineTextFieldView. The UI works ...
Bhavesh.iosDev's user avatar
1 vote
1 answer
128 views

In SwiftUI macOS TextEditor I noticed a weird behaviour, the whole text is sometimes flickering if a word breaks to a new line. Unfortunately I could not find any fix as it appears in this simple ...
sarahaha's user avatar
  • 105
0 votes
1 answer
153 views

I have a TextEditor in SwiftUI and I'm doing some custom things when the user taps return or backspace. TextEditor(text: $item.text) .focused($focusedItem, equals: item.id) .onKeyPress(...
tentmaking's user avatar
  • 2,136
0 votes
2 answers
71 views

I have a very simple TextEditor in a SwiftUI Form to allow users to send feedback about the app. I want to set a minHeight and maxHeight for the text field so that it's clear the user can enter ...
markb's user avatar
  • 1,381
0 votes
1 answer
332 views

I have a LandingView that has a viewModel which is an ObservableObject. LandingView loads some CardViews dynamically and passes a model object (Binding property). CardView further nests four different ...
Rashmi Ranjan Mallick's user avatar
0 votes
0 answers
82 views

I have a TextEditor, which is covered by another View in ZStack: ZStack { TextEditor() MyView() } The idea that I have 2 modes: edit and view. In edit view I remove MyView from ZStack. In view ...
MrSunshine's user avatar
0 votes
2 answers
1k views

I'm working on an app with forms for the user, and I wanted to style my TextField and TextEditor instances the same. The former seem easy enough but I'm not convinced I'm constructing the latter ...
Todd's user avatar
  • 1,983
2 votes
2 answers
697 views

Im building note view with footer over whole UI var body: some View { ZStack(alignment: .bottom) { VStack(alignment: .leading) { Text("\(note.date.formatted())") ...
kabukiman's user avatar
  • 483
0 votes
1 answer
264 views

I'd like try be able to add buttons inside of TextEditor() or a custom text editor. Is this possible with SwiftUI?
Justikun's user avatar
2 votes
1 answer
435 views

I want to make a textEditor have default focus when a view appears in SwiftUI. My approach works for a textField but not a textEditor. I'm not sure why this is. struct ContentView: View { enum ...
Ahmed Zaidan's user avatar
1 vote
1 answer
368 views

My goal is to save the contents only if the user taps "Save", but to discard the edits when they click "Cancel". That's why I created two variables that receive the initial values ...
Douglas Nascimento's user avatar
-1 votes
1 answer
365 views

Xcode on OS X has really nice inline automatic completions / suggestions while editing text with embedded documentation and such. How would I even start to achieve something like this using SwiftUI's ...
Benjohn's user avatar
  • 13.9k
0 votes
1 answer
2k views

I am working on an iOS application using SwiftUI. In my app, I have a TextEditor where the user can enter text. As the user writes and the text becomes longer, the TextEditor's content moves downwards,...
Nenharmha's user avatar
1 vote
1 answer
62 views

I have a problem. I have a view with several TextEditors. Typing in any of them changes the height of all of them. Do you have any idea what happens and how to fix it? Example Code: import SwiftUI ...
Ariel Antonio Fundora's user avatar
0 votes
1 answer
1k views

With the below code, if we run on simulator the editing seems to work. However in the swift UI preview it does not seem to be editing. It shows "Scan Text" but not allow me to enter text ...
NNikN's user avatar
  • 3,858
0 votes
1 answer
660 views

I want to have a placeholder when there is no text in the texteditor, is working well, but the placeholder is not on the same line with the cursor of the TextEditor. I tried to replace the TextEditor ...
user avatar
2 votes
1 answer
373 views

Using Apple Pencil with SwiftUI text editor, when the user presses and holds in the middle of text already in the editor box a crash occurs. This is very reproducible even on this minimal example. ...
Mike R's user avatar
  • 658
0 votes
2 answers
944 views

I am having trouble getting the SwiftUI TextEditor to work when it is in a Child View. This is a small example that demonstrates the issue for me: import SwiftUI struct ContentView: View { @State ...
altimes's user avatar
  • 470
6 votes
1 answer
496 views

I have a two text fields on my View. I want to be able to tab between them. It is currently writing the tab into the text content. struct MyView: View { @State var field1: String @State var ...
iphaaw's user avatar
  • 7,242
4 votes
0 answers
918 views

I want to paste an image in line with text like apps one note or notion do. I read somewhere that it's impossible with TextEditor and I had to use UITextView instead, so I did that but I do not know ...
Nat Serrano's user avatar
0 votes
1 answer
275 views

I am trying to display this text inside TextEditor in full screen but it is showingup inside this scrolling frame. I've tried this method .fixedSize(horizontal: false, vertical: true) on TextEditor ...
Hitesh Suthar's user avatar
2 votes
0 answers
116 views

struct Test: View { @State var text: String = "" var body: some View { ZStack { TextEditor(text: $text) Rectangle() ....
Andrew's user avatar
  • 11.9k
1 vote
1 answer
283 views

I haven't found any documentation on it. I know you can dismiss keyboard using .keyboardDismissMode on TabliewView and other UIViews but how would you do that with TextEditor() in SwiftUI? I have a ...
alex's user avatar
  • 164
0 votes
1 answer
498 views

I have a TextEditor that i want to add a clickable Hyperlink using the TextEditor text.append() TextEditor(text: $textE) .textFieldStyle(.roundedBorder) textE.append(contentsOf: &...
ozk's user avatar
  • 11
1 vote
0 answers
69 views

I'm trying to update the text inside TextEditor via code with no luck and i can't find any examples - Xcode swift basically I would like to create a scrollable multiline log that can be highlighted ...
ozk's user avatar
  • 11
0 votes
1 answer
2k views

I have a TextEditor using SwiftUI 3.0 and every time a new line is created I want to increase the editor height by about 16 points . The issue that I have is that my code is not recognizing the new ...
user1591668's user avatar
  • 2,935
1 vote
1 answer
3k views

I'm trying to capture the text typed in a TextEditor, store it in a variable and update what is displayed on the TextEditor itself. I'm using the .onChange() to trigger and capture what is being typed,...
Boga's user avatar
  • 371
1 vote
0 answers
419 views

I'm trying to add a TextEditor to my project with a different background color. I'd like to just use the simple extension that's found in this post: Transparent Background for TextEditor in SwiftUI ...
nickcoding2's user avatar
0 votes
0 answers
515 views

I am using a SwiftUI TextEditor and would like to change the color of characters from when user has typed in a certain number of characters. Is there any way to achieve this? So there will be two ...
alionthego's user avatar
7 votes
0 answers
790 views

In SwiftUI I'm trying to get my TextEditor content into leading alignment with the Text above it. I have a pattern to do this in UIKit but can't seem to find the correct modifiers in SwiftUI. In the ...
Dustin Pfannenstiel's user avatar
1 vote
0 answers
382 views

Problem I am working on a simple SwiftUI document-based app on macOS (12.0.1) with Xcode 13.2.1. In my app, I need two TextEditors in the document view. One displays the content of the document, and ...
23786's user avatar
  • 11
4 votes
1 answer
2k views

I'm adding margins to the TextEditor. While keeping these margins as clickable area. I was able to add textContainerInset and problem is that added Inset is not clickable. Current code: extension ...
yaosamo's user avatar
  • 166
7 votes
3 answers
6k views

On SwiftUI's TextField you can set an action for the return/submit button of the keyboard using the .onSubmit() modifier. How do you achieve the same with TextEditor? (.onSubmit() doesn't seem to work....
unknown's user avatar
  • 1,038
13 votes
2 answers
6k views

Is it possible to scroll to the TextEditor's current cursor position? I have a List with a TextEditor as the last row. I'm scrolling to the last row of the List to make sure that the TextEditor is ...
unknown's user avatar
  • 1,038
3 votes
1 answer
2k views

I'm working with a SwiftUI List with a TextEditor at the bottom of the List. The TextEditor becomes active or "Focused" when a button is pressed. To achieve this, I have added a .focused ...
unknown's user avatar
  • 1,038
4 votes
1 answer
2k views

I have a SwiftUI List with a TextEditor as the last row. In SwiftUI text fields automatically move up above the keyboard. But unfortunately when the TextEditor is in a List it doesn't seem to work. ...
unknown's user avatar
  • 1,038
9 votes
2 answers
4k views

When I update the isDisabled state variable in my view, it updates the .disabled modifier of my text field as expected, but it then causes about 40 instances of the following error to appear in the ...
wristbands's user avatar
  • 1,427
1 vote
1 answer
704 views

I'm working on a SwiftUI View with a NavigationBar. The view is very simple, it's a full-page TextEditor: struct NotesEditingScreen: View { @State var text: String var body: some ...
robotsquidward's user avatar
0 votes
0 answers
191 views

I am using this EditNotesView, which when I coded it 6 months ago worked fine, but now when I tap in the TextEditor the keyboard comes up, but there isn't a cursor in the TextEditor. If I tap again ...
GarySabo's user avatar
  • 6,830
2 votes
1 answer
789 views

I am trying to style a Text Editor in SwiftUI to look like a Material Design element. Currently, I'm struggling with the floating label. I cannot figure out how to capture the editing state of Text ...
Filip Jurković's user avatar
4 votes
3 answers
6k views

I'm looking for a way to make a swiftUI TextEditor look like a TextField. I need a multiline input but I really like the appearance of rounded TextFields. This is the closest I was able to get: Using ...
Cameron Delong's user avatar
2 votes
3 answers
797 views

I have a TextField as search box.I want to make it autosearch i.e whenever i will enter a letter in the TextField, i should get the result without press a enter.Here is my code: TextField("Search&...
Santanu's user avatar
  • 347
7 votes
2 answers
16k views

How to do this in SwiftUI in TextEditor? I thought of reading return from keyboard. TextField has onEditingChanged and onCommit, but TextEditor doesn't. In Notes app it detects automatically the ...
MikeMaus's user avatar
  • 415
2 votes
1 answer
3k views

iOS 14.4 + Xcode 12.4 I want to make a simple checklist in SwiftUI on iOS where the text for each item is a TextEditor. First, I create the basic app structure and populate it with some demo content: ...
Clifton Labrum's user avatar