A padding modifier in SwiftUI takes an EdgeInsets
, eg
.padding(.leading, 8)
However, there are only leading and trailing EdgeInsets, and not left and right. This presents a problem because not everything in RTL languages should necessarily be reversed from the way it's displayed in LTR languages.
Is there a way to achieve the same or similar effect as the padding modifier, which forces the padding to be on left or right side, regardless of directionality of the language?
layoutDirection
is read-write env value, so let's imagine what happens if someone in parent view will need to change it intentionally to value opposite to current system one. – Haemostasis