Abdo asks:
So after adding modifications the View component can get very complex and maybe conform to other protocols and the word some tells the compiler to only focus on the View part?
Aye!
That's what @rooster said! And @twoStraws in the video noted by @Nigel.
@rooster shows an actual example of a complex view. It hurts my eyes just trying to interpret it. Can you understand what Type this view is?
It's a button, with some padding, and a background color. Wait. It also has a rounded rectangle clip shape, with some Text. It looks like the whole thing is in a VStack? No wait, is the Text in the button? or in the VStack??
This shows that we are not equipped to interpret the exact type of a View
after applying a number of modifiers. It's just insane. Yet, the compiler is GREAT at doing this.
Instead of trying to code and understand the final Type
, we just tell the compiler to look for some View.
VStack<TupleView<(Button<ModifiedContent<ModifiedContent<ModifiedContent<Text, _PaddingLayout>,_BackgroundModifier<Color>>, _ClipEffect<RoundedRectangle>>>, _ConditionalContent<Text, Text>)>>
I hope I said the same thing by using an abstract (wizard and door) example.