ios – Taking part in with SwiftUI

I’m attempting to be taught SwiftUI and obtained puzzled to be taught that not solely order of modifiers matter, some modifiers may be repeated and provides totally different outcomes. For example, I don’t know how I might determine the output of this code.
struct ContentView: View {
var physique: some View {
Textual content("Howdy world")
.font(.largeTitle)
.body(maxWidth: .infinity, maxHeight: .infinity, alignment: .middle)
.background(Shade.inexperienced)
.foregroundStyle(Shade(uiColor: UIColor.systemRed))
.body(width: 200)
.body(maxWidth: .infinity, maxHeight: .infinity, alignment: .middle)
.background(.pink)
}
}
It does produce one thing however one thing not very intuitive. Can somebody clarify what is going on on right here and easy methods to predict the output of physique
var?
EDIT: Based mostly on the feedback that every assertion takes earlier view as enter and outputs a brand new view, that’s understood. However typically this understanding does not work as within the code beneath:
var physique: some View {
Textual content("Howdy world")
.font(.largeTitle)
.body(maxWidth: .infinity, maxHeight: .infinity, alignment: .middle)
.background(Shade.inexperienced)
.foregroundStyle(Shade(uiColor: UIColor.systemYellow))
.body(width: 200)
.body(maxWidth: .infinity, maxHeight: .infinity, alignment: .middle)
.background(.pink)
.foregroundStyle(.crimson)
}
Repeating .foregroundStyle()
with totally different colour does not produce a brand new view with crimson textual content.
Credit: www.ismmailgsm.com