Search code examples
swiftswiftuimodifier

What is the default value of the padding modifier in swift?


just a quick question. I couldn't find the default value of Swift's .padding() modifier.

ModelSelectorItem(variant: variant)
    .padding()

I know that I can just omit the value and swift is providing the default value on its own.

Q: What is the default value of the .padding() modifier in SwiftUI?


Solution

  • As far as I understood from Apple's documentation, there's no standard value and it's calculated based on some criteria by Apple. So, it may be different for different devices, accessibility settings of user, if user is using the app in side-by-side mode on iPad, etc...

    Here is the documentation:

    The set of edges along which to pad this view; if nil the specified or system-calculated amount is applied to all edges.