Profile Photo
I have a simple SwiftUI View that is used for a macOS form. The user can select a option to show/hide detail in the form. I am trying to show this detail using an animation, similar to switching between options in the settings app. The form should grow/shrink as the detail is show, and the detail view(s) should animate in.   The code below… (Show more)
in SwiftUI
Profile Photo
I am trying to wrap a NSTextView in a NSViewRepresentable SwiftUI view.   If text is changed, then updateNSView is called, and the view is correctly updated, but how do I do it the other way around?   I want text to be updated when the user types in the NSTextView and I cannot figure out how to do this. The TextView needs a delegate to handle… (Show more)
in SwiftUI
Profile Photo
Is it possible to store previous state in a swiftUI view, and if so, how?   I have a view that can take an optional value as an input. If this value is nil, then I would like the view to change color (to show something is wrong) and show the previous valid value it had.   Below is an example showing what I hope to achieve.   The IntView takes… (Show more)
in SwiftUI
Profile Photo
Appologies if not using the correct forum for this question? however it is closest I could find.   have been disappointed with the lack of Apple documention supporting serial port programming. The best I've found is this website. Are there recommend swift libraries/frameworks for interacting with serial devices via USB? perhaps with some… (Show more)
in Drivers and Device Access
Profile Photo
I would like to set focusRingType to none for a TextField but it does not have this modifier or property.   Is there a way to get to the actual NSTextField (or UITextField) view to set the property, or do I have to write my own SwiftUI view that wraps NSTextField?   The following code would do the job on a NSTextField, and I am looking for… (Show more)
in SwiftUI
Profile Photo
I have a simple SwiftUI view with a TextField in a macOS app. I change the font size of the TextField.   The TextField keeps its original height (prior to changing the font) until it has text, when it suddeny jumps to the correct size.   One work around is to have placeholder text (even an empty string with just a space in it), but then the… (Show more)
in SwiftUI
Profile Photo
I am trying to make a form that is transparent. The only way I found to do this, is to use a NSVisualEffectsView (see code below).   My problem is that I want the view to behave like a normal SwiftUI container (for example a Form), and that it takes the size of its children. I want the resulting window to take the size defined by the children, in… (Show more)
in SwiftUI
Profile Photo
I have a simple form in SwiftUI that I would like to make translucent (e.g. sidebar).  How do I do this?   This would be done with a NSVisualEffectView, so what is the equivelent in SwiftUI? Changing the opacity and blur does not work, plus that would not be the right way.
in SwiftUI
Profile Photo
I have a UI that needs to be updated as the user makes changes in a SwiftUI TextField.   How do I get notified for all changes made?   The onEditingChanged is only called when te text is changed for the first time after being commited, and this does not change the binding text.
in SwiftUI
Profile Photo
How does one remove the focus border for a TextField in SwiftUI?   In Cocoa, setting the border to "None" in interface builder would remove the border.   I've tried using .border with a width of zero, but that does not work. The .border adds another border on top of the focus border.   Setting the style also does not do the trick.
in SwiftUI
Profile Photo
I have a simple child view that contains a text view.   Changing the state of my parent view should change that of my child, but it does not happen.   See the example code below. The Text (green) in ContentView is updated correctly when the button is pressed, but not the child view (Orange).   Why?   struct ContentView: View {… (Show more)
in SwiftUI
Load more items