ScrollView on macOS includes default support for swipe gestures and mouse scroll wheels, but not page up/down, home/end, or arrow keys? #SwiftUWhy
The best workaround so far is from @Orlando: just don't use Picker at all. https://iosdev.space/@Orlando/113731727963783200 #SwiftUWhy
@siracusa my guess as to #SwiftUWhy is because the modern style is to left-align labels and right-align pickers and have a massive gap in between á la System Settings. Though I echo your lament.
Agh!!!!
Turmoil to get there:
3. This broke the debug-only modal AuthPage > NavigationStack > Settings > Buttons append to $path
a. Settings { @.Environment(\.openURL) var openURL } was causing continuous changes to the view itself and blocking the whole UI
b. Solved by replacing OpenURL with `Link(destination:label:)`.
I definitely should’ve been using a Link before but this seems like a #SwiftUWhy
4. Now I need to get those disclosure indicators back in a nice way.
#iOSDev #SwiftUI
Why is there (apparently?) no Picker style on macOS that can be configured with a fixed width, like NSPopUpButton in AppKit?
For example, consider a text field for numeric input followed by a picker for units, both aligned to the right side of a System Settings-style Form. Each time you pick a different unit, the Picker changes width and moves the text field.
This is Apple’s new, favored layout with its new, favored UI framework, but surely this can’t be intended! It’s madness! #SwiftUWhy
I still don’t understand under what conditions Xcode will launch more than one copy of my in-development app (as indicated by its icon appearing twice in the Dock, both running) and how it might relate to SwiftUI previews, but I’m trying not to worry about it too much. #SwiftUWhy
Q: Why is Xcode no longer able to render a preview of my SwiftUI view?
A: *Sometimes*, the answer is that you’ve got a call to a log method on a Logger object in a code path that’s executed when rendering a preview but rarely or not at all otherwise, and this call passes a string without any values interpolated into it (e.g., logger.log(“Hello”)). This causes an error, and this error is only visible in the big spew of output available through the stethoscope icon in the preview pane. #SwiftUWhy
Why in the world does this interface look like this:
.padding(.top, 1)
.padding(.leading, 2)
.padding(.bottom, 3)
.padding(.trailing, 4)
…or this:
.padding(EdgeInsets(top: 1, leading: 2, bottom: 3, trailing: 4))
…instead of the much more idiomatic:
.padding(top: 1, leading: 2, bottom: 3, trailing: 4)
Like, who in the world thought of this foo(.key, value) API interface in a language with named parameters?!
Welcome to my new series on things I don’t understand about Apple’s premier user interface framework. I’m calling it…
To be clear, these are things I don’t understand, not necessarily things that are “wrong.” They sure *look* wrong (or at least “suboptimal”) to me! But maybe there are good reasons, and I just don’t know them yet. SwiftUI experts and historians, please tell me!
The first entry is coming up…