'How to determine width needed for a button in SwiftUI

If I have a string that I will place inside of a SwiftUI button label, how can I determine how much width I need to allow the button to consume such that the text in the button will not be truncated with ellipsis?

This would assume no font size modifier is applied and would take into account the current Dynamic Type size preference.



Solution 1:[1]

The fixedSize modifier as mentioned by Asperi works for this.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pinglock