Some View in swiftUI
Keyword “some” in swiftUI
Unnoticed parts
This blog is about why we putting some view
in body of view in swiftUI
This var body
going to return a view which might contain VStack, HStack, ZStack or any Text. So Something inside a view which going to be return. Thats why only adding some
keyword.
For Example
In this var body
declared as Text
, so only text we can return and we no need of some
keyword before the Text
.
When we try to run with view and without some
keyword
We will get some error like this
when we add some
keyword with it
It will not show any error
Simply - some view
is highlighting any view combination of views will be inside it. Thats it
If any mistake or you need to shout me, comments session in always opened
Nanri vanakkam 🙏