Recorded – watch the full episode on YouTube.
From the position of a UIKit developer, do you think that UIKit is going to decline now that SwiftUI is emerging?
Janina Kutyn: Well, I really honestly know so little about SwiftUI that's it's hard for me to say what is UIKit up against in SwiftUI. But I don't think UIKit is going to be dead for the foreseeable future. It just seems, based on the experiences people are having with SwiftUI, we often hear that, “SwiftUI is so great at this, but this is its limitation.” Something that's really easy to do in UIKit seems to be a limiting factor of SwiftUI and for a lot of people bringing SwiftUI into their own apps. So I think UIKit is definitely going to be there for a little while longer, hopefully forever.
Paul Hudson: Obviously, SwiftUI backs onto UIKit right now, right? That's what it's doing. You're seeing a table view, you see a navigation controller, all that same thing that is there behind the scenes. Plus with its nice new SwiftUI functional approach in front of it, which is great.
“Something that's really easy to do in UIKit seems to be a limiting factor of SwiftUI and for a lot of people bringing SwiftUI into their own apps. So I think UIKit is definitely going to be there for a little while longer, hopefully forever.”
But, that tells me Apple can replace UIKit tomorrow if they wanted to. It's now UXKit. It's now UJKit. It's now AppleKit. I don't care what. And the SwiftUI developers wouldn't care. As long as our SwiftUI code compiles, runs the same, works the same, we don't really care what's behind the scenes. They can replace UIKit, AppKit, don't really care what in the future, which is awesome. The second thing that I keep thinking about is the idea that... Right now, there's a big functionality gap between SwiftUI and UIKit, right, you know?
You know, we can't create a
UITextView natively in SwiftUI. You've got to wrap that yourself. We can't do collection views. We can't do attributed strings. We can't do alerts with text fields, and so forth. You have to hack these things in yourself, which is not a pleasant experience.
And that'll shrink in about six weeks or so when they announce, hopefully, SwiftUI 2 or whatever they say this next thing is. And it'll shrink, but I don't think for a moment that the UIKit folks are sort of standing there waiting for SwiftUI to catch up. They're working on the next cool thing and the next cool thing and the next, next, next, next cool thing. And SwiftUI is catching up. Adding SwiftUI wrappers around them. Well, hopefully, you'll see
MKMapView wrapped next time, for example, or image pickers wrapped next time, for example. But it takes a long time to get there. And UIKit's moving forward. So we might get closer this year and closer next year, but how long will it be until we go, "Oh, we can do that in UIKit or SwiftUI? There's no functionality difference there.” I don't know.
Janina Kutyn: It really depends on what Apple's vision is for SwiftUI and UIKit, right? If Apple decides that SwiftUI is basically the future and how they envision all apps to be done, and they ported all of their system apps to it and they started deprecating UIKit, then yes, UIKit will die. But if that's not what Apple's envisioning, if Apple thinks that these are two perfectly valid tools that we should all keep using, and it depends on the case, then no, UIKit will not die. And I have no idea what Apple is thinking about these two frameworks in the future.
“I don't think for a moment that the UIKit folks are sort of standing there waiting for SwiftUI to catch up. They're working on the next cool thing.”
Paul Hudson: No one knows. Hopefully, Apple know, but no one else outside of Apple really has a first clue at this point because... If I want to do a macOS app, am I using AppKit? Am I using SwiftUI? Am I using UIKit and Catalyst? I just don't know anymore. I'd choose SwiftUI because I'm a simpleton. I like thinking in one track at a time. But AppKit's a fantastic technology with so many power features that you can't do with SwiftUI right now.
So you wrap that thing, wrap this other thing, wrap this third thing, and you end up wrapping large chunks of AppKit to get where you want to be. Could have just started AppKit in the first place, you know?
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 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!
Link copied to your pasteboard.