SplitView icon indicating copy to clipboard operation
SplitView copied to clipboard

Default splitter

Open aehlke opened this issue 4 months ago • 2 comments

I believe these splitter specs are reasonably close to the iOS system default:

bar color: Color.secondary.opacity(colorScheme == .dark ? 0.7 : 0.5) bar thickness: 5 bar invisible thickness (but also as padding, not just an unclipped ZStack): I'm not sure but the default has some padding typically of approximately 16 or so on either side, could measure this Shape: Capsule rather than RoundedRectangle

On macOS I believe it's simply a Divider() by default, with some tolerance on either side.

Secondly, there's no precedence for split views on iOS. Even iPad splitters are static and unmovable Divider()s. So I recommend (if you wanted to make this view fully native feeling out of the box) having something that behaves more like a sheet/popover on iOS, at least in "compact" mode, such as that it has rounded corners at one end, or perhaps even in fact using the new presentationDetent APIs with the very new API for allowing interaction with an undimmed background. However that's less flexible than this currently so some visual stand-in can work.

It's trivial at least to have a groupbox for a view, and a clear background so that the divider floats between rounded groupbox containers. That would feel native on iOS and not require library changes

aehlke avatar Feb 27 '24 21:02 aehlke