Post

Replies

Boosts

Views

Activity

Reply to SwiftUI TextField with optional value working for @State but not @Binding properties
Have a look here: https://www.appypievibe.ai/blog/working-with-binding-in-swiftui#:~:text=In%20SwiftUI%2C%20you%20can%20create,and%20also%20stores%20its%20value or here: https://stackoverflow.com/questions/59247183/swiftui-state-vs-binding Binding does not cause the View to update the body, which State does. So, it's normal it is nor updated. You can see that boundValue is not updated by adding onSubmit: TextField("Bound value", value: $boundValue, format: .number) .onSubmit { print("Textfield submitted", boundValue) }
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’25
Reply to SwiftUI TextField with optional value working for @State but not @Binding properties
May be I missed something of your intent. Why using a Binding here ? That means ContentView is called from another view with a Sate var ? Otherwise, it is a misuse of Binding. I changed to this, which works. struct ContentView: View { @State var boundValue: Double? @State private var stateValue: Double? = 55 var body: some View { CallTextField(boundValue: $boundValue) // TextField("Bound value", value: $boundValue, format: .number) Text("\(boundValue ?? .nan)") TextField("State value", value: $stateValue, format: .number) Text("\(stateValue ?? .nan)") } } struct CallTextField: View { @Binding var boundValue: Double? var body: some View { TextField("Bound value", value: $boundValue, format: .number) } }
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’25
Reply to Bottom Tile Icon Text
Welcome to the forum.   bottom navigation tile when it cannot be localized Why can't it be localized ? Could you give more details as well as screenshot ?   Will the app be acceptable from a publishing point of view? Do you mean Appstore review point of view ? I do not see any reason here for rejection.
Aug ’25
Reply to Xcode 26 SDK/Simulator Download Issue: (-67061 invalid signature (code or signature have been modified)
I've noticed a point when installing ß7. When I installed ß6 and was asked to download iOS, WatchOS… simulators. Which I did. I kept ß6 installed and downloaded ß7 I was not asked to download simulators they are available in ß7 Does it give a hint to a workaround ? Even though I noticed you had the problem with ß6. uninstall ß7 download and install ß6: are you asked to download simulators ? install ß7. In anycase you should contact support and file a bug report.
Aug ’25
Reply to Clarification on the purpose of return value in textFieldShouldReturn
You should find a lot of information in this (old) post. https://stackoverflow.com/questions/33624413/why-textfieldshouldreturn-is-still-working-when-i-return-false The return value from textFieldShouldReturn answers a different question. If the text field has an action for the control event editingDidEndOnExit, that will cause the keyboard to dismiss unless textFieldShouldReturn is implemented to return false.
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’25
Reply to How to disable textfield without making it grayed out?
like having .disabled without graying it out? That would be confusing for the user. It is very important to have a consistent. I tried something. Let me know if that's what you are looking for: struct ContentView: View { @State private var theField: String = "" @State private var disabledField = true @State private var prompt: String = "disabled" @FocusState private var focusedField: Int? var body: some View { TextField(prompt, text: $theField) .frame(width: 200, height: 30) .disabled(disabledField) .focused($focusedField, equals: 1) .overlay( // so the doubletap will be handled, even though textFied is disabled RoundedRectangle(cornerRadius: 4) .stroke(Color.gray, lineWidth: 1) // just to see, color can be set to bg or white .offset(x: -5, y: 0) .onTapGesture(count: 2) { prompt = "Enter" disabledField = false focusedField = 2 // any value ≠ 1: to get the cursor appear when set to 1 DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) { // delay to sequence focus changes and get cursor appear focusedField = 1 } } ) } } You can set the color of the prompt so that it does not appear dimmed TextField(prompt, text: $theField, prompt: Text(prompt).foregroundColor(.blue))
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’25
Reply to Sensitive language ?
I found similar issues in the forum. Spam or abusive language detection is really loosely focused to says the least. for instance a post with F r e e word (to say for instance that Apple's tutorial are) has rejected. I have found 3 options, if you are confident there is no offensive language in your post: write the post, capture image, and attach image instead of text. Split your text until you find offending word (tedious) file a bug report
Topic: Community SubTopic: Apple Developers Tags:
Aug ’25
Reply to SwiftUI TextField with optional value working for @State but not @Binding properties
Have a look here: https://www.appypievibe.ai/blog/working-with-binding-in-swiftui#:~:text=In%20SwiftUI%2C%20you%20can%20create,and%20also%20stores%20its%20value or here: https://stackoverflow.com/questions/59247183/swiftui-state-vs-binding Binding does not cause the View to update the body, which State does. So, it's normal it is nor updated. You can see that boundValue is not updated by adding onSubmit: TextField("Bound value", value: $boundValue, format: .number) .onSubmit { print("Textfield submitted", boundValue) }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’25
Reply to ProofPoint has blocked our IP for a year - am at wits end
You should probably recontact ProofPoint support. The forum is not intended for such support (including for 3rd party products), but for helping developers. So it's not the best place to get an answer.
Topic: Safari & Web SubTopic: General
Replies
Boosts
Views
Activity
Aug ’25
Reply to SwiftUI TextField with optional value working for @State but not @Binding properties
passed in binding Yes, and that was my initial question: to what is it passed ? But I'll let more skilled SwiftUI experts reply.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’25
Reply to SwiftUI TextField with optional value working for @State but not @Binding properties
A Binding is a value that has to be passed to someone. In other words, it has to be bound to something. It does not "exist" per se. See here, which is similar to the code I posted. https://developer.apple.com/documentation/swiftui/binding So, IMHO, that's not a bug, that's a SwiftUI feature.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’25
Reply to SwiftUI TextField with optional value working for @State but not @Binding properties
May be I missed something of your intent. Why using a Binding here ? That means ContentView is called from another view with a Sate var ? Otherwise, it is a misuse of Binding. I changed to this, which works. struct ContentView: View { @State var boundValue: Double? @State private var stateValue: Double? = 55 var body: some View { CallTextField(boundValue: $boundValue) // TextField("Bound value", value: $boundValue, format: .number) Text("\(boundValue ?? .nan)") TextField("State value", value: $stateValue, format: .number) Text("\(stateValue ?? .nan)") } } struct CallTextField: View { @Binding var boundValue: Double? var body: some View { TextField("Bound value", value: $boundValue, format: .number) } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’25
Reply to Bottom Tile Icon Text
Welcome to the forum.   bottom navigation tile when it cannot be localized Why can't it be localized ? Could you give more details as well as screenshot ?   Will the app be acceptable from a publishing point of view? Do you mean Appstore review point of view ? I do not see any reason here for rejection.
Replies
Boosts
Views
Activity
Aug ’25
Reply to Xcode 26 SDK/Simulator Download Issue: (-67061 invalid signature (code or signature have been modified)
I've noticed a point when installing ß7. When I installed ß6 and was asked to download iOS, WatchOS… simulators. Which I did. I kept ß6 installed and downloaded ß7 I was not asked to download simulators they are available in ß7 Does it give a hint to a workaround ? Even though I noticed you had the problem with ß6. uninstall ß7 download and install ß6: are you asked to download simulators ? install ß7. In anycase you should contact support and file a bug report.
Replies
Boosts
Views
Activity
Aug ’25
Reply to Xcode 26 SDK/Simulator Download Issue: (-67061 invalid signature (code or signature have been modified)
You could try to completely reload Xcode 26ß7 from here: https://xcodereleases.com When launching Xcode, you should be asked to download simulators. Hope that helps.
Replies
Boosts
Views
Activity
Aug ’25
Reply to SwiftUI app crash with __swift_instantiateConcreteTypeFromMangledName
Could you show the code ? How many views in the scrollView ? More than 10 ? And try to localise the error: comment out all views in scroll view except the first does it crash ? if yes, analyse this view otherwise, uncomment the second subview and continue until you get a crash Note: if there are many views, you can speed up with dichotomy approach.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Xcode 26.0 beta 7 (17A5305k) / Window 'Device and Simulator' / top part is blurred and overblends important info and toggle
No problem for me testing on ß7: Even if dark mode, but much less readable:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Clarification on the purpose of return value in textFieldShouldReturn
You should find a lot of information in this (old) post. https://stackoverflow.com/questions/33624413/why-textfieldshouldreturn-is-still-working-when-i-return-false The return value from textFieldShouldReturn answers a different question. If the text field has an action for the control event editingDidEndOnExit, that will cause the keyboard to dismiss unless textFieldShouldReturn is implemented to return false.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to How to disable textfield without making it grayed out?
like having .disabled without graying it out? That would be confusing for the user. It is very important to have a consistent. I tried something. Let me know if that's what you are looking for: struct ContentView: View { @State private var theField: String = "" @State private var disabledField = true @State private var prompt: String = "disabled" @FocusState private var focusedField: Int? var body: some View { TextField(prompt, text: $theField) .frame(width: 200, height: 30) .disabled(disabledField) .focused($focusedField, equals: 1) .overlay( // so the doubletap will be handled, even though textFied is disabled RoundedRectangle(cornerRadius: 4) .stroke(Color.gray, lineWidth: 1) // just to see, color can be set to bg or white .offset(x: -5, y: 0) .onTapGesture(count: 2) { prompt = "Enter" disabledField = false focusedField = 2 // any value ≠ 1: to get the cursor appear when set to 1 DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) { // delay to sequence focus changes and get cursor appear focusedField = 1 } } ) } } You can set the color of the prompt so that it does not appear dimmed TextField(prompt, text: $theField, prompt: Text(prompt).foregroundColor(.blue))
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’25
Reply to Sensitive language ?
I found similar issues in the forum. Spam or abusive language detection is really loosely focused to says the least. for instance a post with F r e e word (to say for instance that Apple's tutorial are) has rejected. I have found 3 options, if you are confident there is no offensive language in your post: write the post, capture image, and attach image instead of text. Split your text until you find offending word (tedious) file a bug report
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to How to Detect Key + Modifier Combinations at Runtime in SwiftUI on iOS (Without Using .keyboardShortcut)?
have a look here: https://stackoverflow.com/questions/74658685/how-to-observe-for-modifier-key-pressed-e-g-option-shift-with-nsnotification
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Range For Keys and Values Of Dictionary
@SaurabhSaini thanks for the feedback. But your OP asked for selecting range for keys and values. I do not see how your solution achieves it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’25