Post

Replies

Boosts

Views

Activity

Action of full-width button in ToolbarItem is not triggered
To make a toolbar button that has the maximum width, I proceed as shown below with iOS 26. The appearance of the button is as expected, but its behavior is incorrect. The action is not triggered when tapping within the button, but outside its text. How to make the action triggered when tapping anywhere within the button ? import SwiftUI struct SampleView: View { var body: some View { NavigationStack { Text("") .toolbar { ToolbarItem(placement: .bottomBar) { Button(role: .confirm, action: self.action) { Text("Action") } .frame(maxWidth: .infinity) } } } } private func action() { print("Action Triggered !") } } #Preview { SampleView() }
2
0
117
6h
Action of full-width button in ToolbarItem is not triggered
To make a toolbar button that has the maximum width, I proceed as shown below with iOS 26. The appearance of the button is as expected, but its behavior is incorrect. The action is not triggered when tapping within the button, but outside its text. How to make the action triggered when tapping anywhere within the button ? import SwiftUI struct SampleView: View { var body: some View { NavigationStack { Text("") .toolbar { ToolbarItem(placement: .bottomBar) { Button(role: .confirm, action: self.action) { Text("Action") } .frame(maxWidth: .infinity) } } } } private func action() { print("Action Triggered !") } } #Preview { SampleView() }
Replies
2
Boosts
0
Views
117
Activity
6h
How to build a Help view with hierarchical table of contents ?
In the Keynote/Numbers/Pages apps for iPhone, there is a Help menu item for presenting a Help modal view. The view has a button for showing the hierarchical table of contents, and a field for searching the Help pages. How is such a Help modal view built through SwiftUI ? In which format is the Help content stored ?
Replies
2
Boosts
0
Views
138
Activity
Nov ’25