SwiftUI, a declarative UI framework for Apple platforms, has arrived! Developers with React Native experience may notice some similarities to the philosophies Apple has imbued into their new UI framework. Utilizing structs as immutable value types for view modeling, a declarative syntax, and with their new async event library Combine, a reactive architecture.

That buzzword soup is something to celebrate from Apple, and even though it has barely landed on the Apple Beta program, it may be prudent to evaluate the new technology against React Native, an equally viable choice.

So I attempted to go through React Native’s ‘Basics’ guide and recreate each component they created to highlight the common components developers would use.

These basic guides were actually what I used when learning to make React Native apps so hopefully my attempt at recreating them can illuminate some complexities, and bugs that I encountered when using SwiftUI.

Here is a link to the playground I created for all of the tutorials.

1. Hello World

Hello World is the de facto example used in introducing a new language or technology.

There are certain similarities that should be pointed out. Component is the base class for React Native visual elements. While SwiftUI conforms to the View protocol to define a value type that represents a View.

Text rendering is similar in how succinct it is.

Styling is where React Native and SwiftUI diverge. But the differences will be highlighted in later examples.