NEW: Get your ticket to Hacking with Swift Live! >>

How does SwiftUI compare to React?

Recorded – watch the full episode on YouTube.

Previously you've done a lot of work with web frameworks. How do you think SwiftUI compares to web frameworks such as React?

Meng To: So if I look at SwiftUI, it's a lot closer to React than UIKit, for example, and the way that you even code some of the layout, the modifiers and stuff like that. And also the way you code animations is very different. So yes, SwiftUI is much closer to React, which is why I believe there's such a popularity with SwiftUI right now, especially amongst people who are looking to learn iOS, right?

“Have you tried SwiftUI? That's the question. If you try it, please let me know, because I love it. This is one of the best things have used at least over the past five, six years, for sure.”

Those who have learned Swift in the past, they love Swift, they love the iOS platform, but the key is how do we convince the rest of the audience, those people who are considering Flutter who are considering Jetpack Compose or React Native, or all sorts of platforms that does cross platforms and whatnot.

Well, how do you convince them to use SwiftUI? The key to me is that you have SwiftUI. I think it's a lot simpler. It's a lot more modern. It's made by Apple, which means that it supports all of these SDKs and powerful things that you can do in iOS and it's native.

“SwiftUI does build on lots of the same concepts that really took off in React and we should be very grateful to that community for inspiring this kind of work and letting us take ideas from there.”

There's nothing you can ask more than that. The power of native cannot be understated. I suggest every designer, developer to really look at how you can build something in SwiftUI before judging it, because a lot of people are, they're like, “hey, I want to wait a little bit for SwiftUI. I want to wait because Flutter seems interesting. It's a cross platform. It has a lot of new ideas.” But have you tried SwiftUI? That's the question. If you try it, please let me know, because I love it. This is one of the best things have used at least over the past five, six years, for sure.

Paul Hudson: Certainly there are some developers who say don't learn JavaScript. It's not a nice language or whatever, but actually it's done a lot to inspire other languages, including Swift. As you say, SwiftUI does build on lots of the same concepts that really took off in React and we should be very grateful to that community for inspiring this kind of work and letting us take ideas from there.

Would you say that we had seen similar levels of interest from designers for React as we have done for SwiftUI?

Meng To: Well, you brought up a great point. React definitely inspired SwiftUI in my opinion. To me as a designer, I always look for the best ideas. I always look for the best tools to use. And I'm not sponsored by SwiftUI. I mean, there's no way I can get sponsored by SwiftUI anyways, but it's just one of the best things I've ever used.

One thing that happened when I was teaching UIKit, because I've been teaching UIKit for about five years, is that one, it was very difficult to get a lot of people on board especially in term of getting Storyboard.

“And I'm not sponsored by SwiftUI. I mean, there's no way I can get sponsored by SwiftUI anyways, but it's just one of the best things I've ever used.”

There's a lot of division amongst folks who are using iOS to say, "Okay, should I use Storyboard? Should I use everything in Coach? Should I use Interface Builder?" There's so many things. It's very divisive. And then for me, it was very clear that if I wanted to teach the designers and get them to use Xcode, that I have to teach them Interface Builder, and Storyboard and try to connect it to the code.

But the problem is not with Interface Builder necessarily. The problem is after, right? Midroad, you have to connect the IBOutlets to the code. The editor itself, there's nothing wrong, but at some point you're going to be like, "I want to do more than this. I want to do animation. I want to make it more powerful. I want to have interactions." And if you want to do that, then you have to connect everything in code. And as soon as you do that, then it makes more complicated than either one. And to me, SwiftUI feels like the answer to that problem.

This transcript was recorded as part of Swiftly Speaking. You can watch the full original episode on YouTube, or subscribe to the audio version on Apple Podcasts.

Listen on Apple Podcasts

Hacking with Swift is sponsored by Essential Developer

SPONSORED From August 2nd to 8th you can join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer!

Save your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

BUY OUR BOOKS
Buy Pro Swift Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift (Vapor Edition) Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Server-Side Swift (Kitura Edition) Buy Beyond Code

Was this page useful? Let us know!

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.