DEV Community

Discussion on: An Introduction to SwiftUI for React Developers

Collapse
 
laplacesdemon profile image
Suleyman Melikoglu

It’s amazing how much Swiftui resembles react.

I found it weird that the rendered contents are defined in a property instead of a function. Why not a render function instead of body? Or even better, why not just return the body from a function?

One thing I noticed is how little docs/sources for testing swiftui components. I guess testing is not too important for swiftui folks.

Collapse
 
bmcmahen profile image
Ben McMahen

It's true - there's basically nothing about testing in the docs. But it's still in beta, and I suspect these details will be flushed out soon. In general I find the docs really limited, actually. Besides their main tutorial, learning some basic patterns has been quite the challenge.

I'm curious as to why they define a property vs a function. Wish I knew more about Swift to make an informed guess!