What's new in SwiftUI

RSS for tag

Discuss the WWDC22 Session What's new in SwiftUI

Posts under wwdc2022-10052 tag

27 Posts

Post

Replies

Boosts

Views

Activity

How to set the holding priority with NavigationSplitView
My question concerns a macOS SwiftUI app. I would like to have a split view with 2 horizontal panes without sidebar: content on the left and inspector on the right. The inspector should act like the inspector panel on the right side side of the Xcode's window: when the window is resized, the inspector keeps it's current width and the user can resize the inspector using the split divider. Using macOS Monterey SDK, I tried to achieve this with HSplitView but the problem is that the left/right panels are both resized when the window is resized. struct ContentView: View { var body: some View { HSplitView { Rectangle().fill(.red) Rectangle().fill(.yellow) } } } Using Ventura SDK, I just tried the new view NavigationSplitView. I'm using .constant(.doubleColumn) to hide the sidebar but the problem is the same as HSplitView, the left/right panel are both resized when the window is resized. struct ContentView: View { var body: some View { NavigationSplitView(columnVisibility: .constant(.doubleColumn)) { Text("not used") } content: { Rectangle().fill(.red) } detail: { Rectangle().fill(.yellow) } } } When using NSSplitViewController with AppKit, the holdingPriority (https://developer.apple.com/documentation/appkit/nssplitviewitem/1388887-holdingpriority?language=objc) allows to manage this case: The view with the lowest priority is the first to gain additional width if the split view grows or shrinks. Is it possible to achieve this with SwiftUI?
2
1
1.8k
Jun ’22
ImageRenderer fails to render maps
The new ImageRenderer in SwiftUI is really great and should help me to remove some custom code I've had to write in the past. I've noticed that when used to capture a view that contains a map view, the map is replaced with a 'no entry' sign 🚫 Is this intentional? Here's some sample code to replicate the issue: https://gist.github.com/shaundon/282cf7ff276093681a1c246ae318c9d4
1
1
1.6k
Jun ’22
How to set the holding priority with NavigationSplitView
My question concerns a macOS SwiftUI app. I would like to have a split view with 2 horizontal panes without sidebar: content on the left and inspector on the right. The inspector should act like the inspector panel on the right side side of the Xcode's window: when the window is resized, the inspector keeps it's current width and the user can resize the inspector using the split divider. Using macOS Monterey SDK, I tried to achieve this with HSplitView but the problem is that the left/right panels are both resized when the window is resized. struct ContentView: View { var body: some View { HSplitView { Rectangle().fill(.red) Rectangle().fill(.yellow) } } } Using Ventura SDK, I just tried the new view NavigationSplitView. I'm using .constant(.doubleColumn) to hide the sidebar but the problem is the same as HSplitView, the left/right panel are both resized when the window is resized. struct ContentView: View { var body: some View { NavigationSplitView(columnVisibility: .constant(.doubleColumn)) { Text("not used") } content: { Rectangle().fill(.red) } detail: { Rectangle().fill(.yellow) } } } When using NSSplitViewController with AppKit, the holdingPriority (https://developer.apple.com/documentation/appkit/nssplitviewitem/1388887-holdingpriority?language=objc) allows to manage this case: The view with the lowest priority is the first to gain additional width if the split view grows or shrinks. Is it possible to achieve this with SwiftUI?
Replies
2
Boosts
1
Views
1.8k
Activity
Jun ’22
List Row Inset top/bottom not work in SwiftUI4
The Text("Top")/ Text("Bottom") not my want effect.
Replies
0
Boosts
0
Views
899
Activity
Jun ’22
How to set color/Image background to ''Form" in SwiftUI 4?
I can't finish the effect like that:
Replies
1
Boosts
0
Views
3.1k
Activity
Jun ’22
Xcode 14 Donut App Sample Code
Does anyone know where to find the sample project?
Replies
2
Boosts
1
Views
2.4k
Activity
Jun ’22
Toolbar Roles behavior
I have tried a lot of codes to see what’s the difference between browser and editor, but I can’t find some changes between those two things, so i’m wondering what’s the difference between browser and editor?
Replies
2
Boosts
0
Views
1.2k
Activity
Jun ’22
ImageRenderer fails to render maps
The new ImageRenderer in SwiftUI is really great and should help me to remove some custom code I've had to write in the past. I've noticed that when used to capture a view that contains a map view, the map is replaced with a 'no entry' sign 🚫 Is this intentional? Here's some sample code to replicate the issue: https://gist.github.com/shaundon/282cf7ff276093681a1c246ae318c9d4
Replies
1
Boosts
1
Views
1.6k
Activity
Jun ’22
Reorder List items across multiple sections? Reorder outline group items?
Anything new this year to support reordering outline group items or items across sections in a multi-section list? I really want to code my sidebar in swiftUI but user driven ordering is a must for me.
Replies
0
Boosts
1
Views
1.1k
Activity
Jun ’22