|< What should you use for new iOS apps: SwiftUI or UIKit?||How to integrate UIKit and SwiftUI in the same application >|
Recorded – watch the full episode on YouTube.
SwiftUI opens up the possibility of going to macOS, tvOS, and watchOS if you want to go in that direction – has it encouraged you to think them, or are you sticking with iOS?
Ish Shabazz: I'm for sure thinking macOS. I've always thought about macOS and just thought it was a gigantic hill to climb, so now I'm thinking more about macOS. watchOS has changed a lot over time, but what I've realized is that for the kind of apps that I normally write, which is like a productivity-style app, the watchOS just isn't the right place for a dedicated app, per se. I would think more about like widgets and things like that.
"My favorite newcomer is the Messages app, because now I can use the message effects, which has always been one of my things, because I like fun."
And then tvOS is… I love tvOS, but it's really content-driven. If you don't have content, do you really belong on tvOS? And for the stuff I do it's not content, but if you're doing any fitness things like that, I think that both those platforms is a great place for it. The beauty is that if you change your mind down the road, you already have the UI built out and it's ready to go on all these platforms and feel native, which is fantastic.
Paul Hudson: And I'm not sure folks necessarily realize how SwiftUI's semantic approach to stuff actually makes it very easy to adapt your UI automatically to other platforms. For example, when you have like a tab view on iOS, you get a tab bar controller across the bottom. On macOS, it becomes a tab group box that you might have in some of the settings applications. On watchOS it's a paging view with dots you swipe between left and right, and on tvOS it’s a segmented control on top, like the Movies app for example. And it's the same tab view in code – the same tab view does all four of those things automatically because you aren't saying, "I want a
UITabBarController doing this exact thing." It adapts itself automatically to fit the right thing for the platform, which works so, so well.
I think with macOS particularly now that Big Sur has a very nice UI theme out of the box, where it has the slightly translucent frosted sidebar going all the way to the top – it looks good out of the box. And macOS struggled with that for quite a while, to have good-looking apps out of the box. It hasn't done a good job with that, but now it does. And I'm hoping that means we'll see an explosion in macOS applications because SwiftUI doesn't make it so easy I think.
"The beauty is that if you down the road, change your mind, you already have your school kit there. You already have the UI built out and it's ready to go on all these platforms and feel native, which is fantastic."
Ish Shabazz: For sure, I think that that's going to happen for two reasons. One is as you're mentioning SwiftUI is doing a good job, right? The other is the Apple Silicon chips being able to run native code for iOS. I think the combination of these things is going to make a lot more applications work well and look great on the Mac.
Paul Hudson: I certainly think this has made Catalyst apps look better. They look more like native macOS apps now as opposed to UIKit apps sort of living uncomfortably in a macOS world.
Ish Shabazz: Well, here's what I will admit: I was not using Catalysts app so much before Big Sur. So when Big Sur came along, then I kind of hopped on board.
Paul Hudson: Certainly Apple are backing it under because News, Home, Stocks, and more – they're all written in Catalyst, right?
Ish Shabazz: For sure. It's like all the apps that you really don't use that much on Mac! I mean, the Home app – how often do you use Home on the Mac? I think it was the Voice Notes app was using it. My favorite newcomer is the Messages app, because now I can use the message effects, which has always been one of my things because I like fun. And I like to slam down messages or shoot off fireworks and lasers!
Paul Hudson: And now you can.
Ish Shabazz: And now I can, so that brings me joy!
Paul Hudson: If nothing else, Catalyst will let you do fireworks in your iMessage – that's the main thing.
Ish Shabazz: That's a major draw for me, yeah!
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.
SPONSORED AppSweep by Guardsquare helps developers automate the mobile app security testing process with fast, free scans. By using AppSweep’s actionable recommendations, developers can improve the security posture of their apps in accordance with security standards like OWASP.
Link copied to your pasteboard.