Profile Photo
I would like to keep my layout the same, and only rotate views in-place when the screen orientation changes.   Below is a simple example of what I am trying to acieve. It shows to TestViews horizontally when in portrait mode, and vertically when in landscape mode.   I've made sure that the views themselve does not get re-created in the hope that… (Show more)
in SwiftUI
Profile Photo
My question is slightly broader, but hopefully this simple use case states the point.   I ofthen run in to the problem where my source of truth is a custom type (struct, array of bytes, int, etc.) that I want to edit. I would like to write a view that has a binding to this type so that all the editing logic lives inside this view without the… (Show more)
in SwiftUI
Profile Photo
How do I read the product string of a USB device?   I've used IOServiceGetMatchingServices to get to the device that I need, but I want to display a user-friendly name.   I've used IOService utility app to look at all the keys for the device, but none of the keys have the product name.   Searching the web, I found kUSBProductStringIndex, so… (Show more)
in Drivers and Device Access
Profile Photo
I am trying to write a simple view that displays text, two lines at a time. It must be possible for the user to move up and down in the stack of text.   In order to make it look good, the items scrolled in and out of the stack must transition in and out from the top or bottom based on the direction the user selected. Below is some test code that… (Show more)
in SwiftUI
Profile Photo
I've been playing with my own custom view and Animatable to make it animate.   I got it going, but do not understand 100% what happens behind the scenes, and this is never good to help understanding something.   Take for example the following simple struct: struct MyRect: Shape {… (Show more)
in SwiftUI
Profile Photo
I have some swiftUI code that used to work, but somewhere, in the recent xcode updates it stoped working.   The following simple example demonstrates my problem: struct ContentView: View {… (Show more)
in SwiftUI
Profile Photo
I am trying to create a standard stepper with text field in swiftUI, but it does not seem to exist.   I need something that looks like this:   Do I have to create my own view, or is something already available?   I tried an HStack with Text, TextField and stepper, but this does not align properly when placed in a form, and the stepper and… (Show more)
in SwiftUI