The same report for the third time: a SwiftUI button responded only on its text, and my two earlier “fixes” did nothing

日本語版

Development log of the Toreca Dash app / August 2026

The application-record screen of my app Toreca Dash has “Won” and “Lost” buttons. A report came: “the buttons only respond on the text; hard to use”.

This was the third time I got that report (20 July, 1 August and 27 August). I had thought I had fixed it twice. The code said “fix”. And yet it had never been fixed.

Written from my work log of 27 August 2026.

The first two fixes did not work

The first two times I “added .contentShape” and “moved .buttonStyle(.plain)”. The real issue was the order of the modifiers, and I had not got the order right.

SwiftUI’s Button("Won") { … } has a label that is only text. Adding .frame().padding().background() outside to make it look bigger still leaves only the text responding to taps. The visible size and the tappable area were different things.

The fix: build the look inside a ButtonStyle

If you build the button’s look inside a ButtonStyle (the mechanism that defines a button’s appearance), the result is exactly the tappable area. Build it inside, not outside. I created an ActionButtonStyle and replaced six places (Won, Lost, Applied, enter announcement date, and “Apply” in two filters).

Two similar items the same day

Other reports that day had the same root.

What I learned

Before writing “fixed”, search for the same shape elsewhere.

This is the English version of the original Japanese article.

More in English