Watching this at the end of 2023, I can say I have no need to learn UIKit with SwiftUI. I come from a ReactJS background and learning SwiftUI just made a lot more sense given it's declarative nature and less boilerplate code. Very happy to learn SwiftUI it's so far so good.
Your videos are so good I’ve bought your book and now I watch and click on all the ads on your videos to make sure that you get every last cent out of the advertisers. You deserve it!
I would really like to see a similar video comparing UIKit (with Storyboard) compared to SwiftUI. I really appreciate this video though!! I’m finding the switch from UIKit to SwiftUI to be EXTREMELY difficult though honestly... It seems so difficult to write clean code using SwiftUI
Mate, this is funnier than expected! You make UIKit look like an old timer :) This video definitely convinced me to move into SwiftUI prototyping as honestly I've got completely cluttered into Storyboards and ViewControllers mixed with code and seques and all of that ... just to build the prototype for development... :)
Great comparison but I HIGHLY enjoy that kind of video template. I hope I'll see more video-templates like that from you, where the coding is done quite fast and you comment stuff in real time with pause breaks. Great way to keep video relatively short, busy millennials like me really appreciate this ! :)
I’m learning Swift as a hobby. I use Interface Builder instead of coding with UI kit. It’s intimidating to see that I will have to learn how to programmatically make a UI. Your videos help me so much and help me gain experience in Swift too. Thank you.
I wish many people using this side by side way of comparing frameworks, it's very helpful when one wants to decide on which to use. Thanks +Paul Hudson
Thanks Paul for this great video! I actually started to use SwiftUI on my main project couple of months ago and I'm mostly satisfied except for one problem which is backward compatibility. Many great features of SwiftUI today are exclusively available for iOS 15 which makes me feel that I should've waited for a year or two not to get new features but to only use the existing ones while being able to support at least two major versions of iOS
if you are comparing both the framework and time to achieve the specific milestone , you should have chosen the fastest way for implement UIKIT which is through storyboard then we could call it a fair comparison .. by this time , this comparison is not fair .. we can achieve these milestones in much quicker way in UIKit by using Storyboard , outlets , actions etc Btw i like the way you are comparing frameworks
Also, one could use awesome github repos like TinyConstraints in making layout super fast. The main difference between SwiftUI and UIKit is not how fast you can build apps, but how to approach building apps. This has also been said by Paul in numerous other videos of his.
as we create a new project, we are choosing to use SwiftUI or Storyboard, not UIKit... so i would say, if we know how to use storyboard very well, it might not be slower than using swiftui
Cool! Having three instances of Paul might make it even better: one working with and advocating/apologizing for UIKit, one working with and advocating/apologizing for SwiftUI, and one moderating.
Thanks Paul, very informative. I'm starting out with IOS development and I needed to know what I am getting myself into. You simply made things easier for me. I truly appreciate you.
5 лет назад+1
“Hacking with SwiftUI” will be best series on RUclips !
This was amazing! Loved the comparison, and it’s great to still show that UIKit still has the power to make iOS apps. It’s gonna be with us a lot more, until SwiftUI gets the power to compete with UIKit in bigger projects. 😉
I wrote an app to be used within the company I work for and was stunned of how quickly I a managed to write the app in SwiftUI including having to fetch a JSON from my API. But I agree I am still working with both UIKit and SwiftUI.
I'm not sure how valid this is, usually you use SnapKit or some extensions for constraints, but also you choose app format where SwiftUI really shines. Anyway nice comparison, thank you.
Thanks, Paul! This was a good comparisson for these two frameworks. I will stay at UIKit, but SwiftUI is definetely a good way for building new Apps with limited functionality quickly.
Yeah but where is today Objective C ? So that far will go UIKit to will disappear as well just like Objective C so UI Swift will be taking he's place very Soon
@@raitasorin Not that soon, i suspect that another 2 solid years uikit will still be top. Then slowly fade away. The swiftui will need at least 2-3 years to mature at the point where you can make a real complex app. UIKIT is here for 10 years now...
@@guitaripod iOS 13 still has quite a few awful glitches. Forcing people to dispose a working device for sake of new way of arranging views in the editor is kind of a weak excuse. It's not revolutionary either. React Native goes with this concept a bit better: more forgiving view state management, stylesheets, etc. I have new devices for testing, but iPhone 6 is still more usable, even after I bought lightning-audio-data port adapter. TBH, newer iPads have sidecar option and apple pencil. First one is slightly glitchy, but second one is a killer option (both in terms of usability and price)
Super cool demo. But I feel it’s not exactly fair to do all the layout in code for uikit. I’m a believer in doing that in the visual editor. Wouldn’t most people do it that way?
As you said, UIKit and SwiftUI cannot easily be compared. For instance I'd usually create a xib file for the detailview just to make the layout with all the constrains using the interface builder. This is because the constrains in code are so ugly and take a lot of time to write. Now in SwiftUI constrains aren't a thing anymore and create elements by code is made a lot easier. So it's still not completely fair to write everything in code and time it. Then of course SwiftUI will be better.
Not fair at all, there is no need to create detail view controller in code, you can just drag and drop UI controls on storyboard and create whole screen easy. This would for sure reduce lines of code for UIKit, and I think you did it on purpose this way. I don't say UIKit is better, or that SwiftUI is better, just that this was not good enough comparison.
Take a moment to notice how SwiftUI introduces multiple levels of abstraction with extra `UIViews`, while UIKit keeps the view hierarchy looking neat and simple. 🎉
Really inspiration video for me. As react native developer,I don't know about it much. I want to know the SwfitKit and UIKit. Your video made me clear. Thank you.
great video Paul! However, I think that with swiftUI (for the time being) it's a bit harder to make a really custom UI - currently we are using here basic UIKit ported elements. What you think? SwiftUI is more concise, no boilerplate code. Don't get me wrong, I am currently hesitating to start build a complex UI with SwiftUI.
SwiftUI is still the new kid on the block, but when a UI component is missing one can always use the UIKIt version of it with UIViewControllerRepresentable
Why didn't you use a storyboard on your StarshipViewController and just pass around the values? Although sometimes buggy, I think the storyboarding is one of the strengths of UIKit
I love your videos... I know I'm late to respond but to be honest, I would rather like to see a video comparing the headaches involved in trying to figure something out that is not working as expected and the time it takes googling or jumping into the documentation for solutions. I think in that case, SwiftUI development might be slower (but that's just me).
Yes and that's why I think it's not really a fair comparison. UIKit is meant to be "meant to be" used with the storyboard to set stuff up and then programmatically tweak it a bit. I think it would have finished very close if not faster.
@@punishedbrains9954 Using SwiftUI ist much faster then Storyboards and UIkit. Example: Try setting up a table with Storyboard. You will have to add it to Storyboard, add a cell, design the cell. Then drag everything into your view controller. Then add the delegates, and delegate methods, then implement the code to tell the table how to deal with the data, which you will also have to implement. Now compare all this with how it works in SwiftUI: Just wrap whatever content you would like to have in a cell in "List(){..}". Finish. ^^Thats it. No Protocols, methods, data, etc.
@@Seitenwerk except when your table starts to grow immensely. Or if you'll need to perform animated edits to the table. Or if you need just to scroll somewhere in the list. Or basically anything other than a flashy demo. I think SwiftUI has giant potential but it's still just a tool for quick prototyping
Paul, I did not know these features like customSpacing for stackView and fast coding in UIKit. I am tired so much of spacing in stackView, thanks for that method a lot!
Compatibility. Unfortunately SwiftUI is only available for iOS 13.0 and higher. Using SwiftUI would thus mean that you can no longer support people with older devices. There are still millions of iOS devices out there with iOS versions older than iOS 13, and are no longer be updated because Apple (policy) does not supply updates for this older devices. Take, for example, a banking application with millions of users. Of course, as a bank, you must support as many devices as possible, even those that are bought a long time ago. These are your customers, were you are depending on, whether rich or living on a small budget. Note that for a lot of people, iPads and iPhones are relatively expensive devices. if you live on a small pension budget, in many cases you can't even afford to replace your iPad or iPhone There are millions out there that can't. That is why I make my apps available starting with iOS 9. Unless special features only available in later iOS versions are needed e.g. like AR. I have absolutely no problem with targeting starting with an old iOS version. (but maybe Apple has, because from a commercial point of view of a hardware seller, it is more profitable to "encourage" people to replace their devices as soon as possible. However, I wouldn't go that far to say that Apple is introducing new tools like SwiftUI all the time for that very reason..) Using UIKit is not so hard as it might look for beginners, especially when using a language like Swift. Paul, you're talking about a lot of boilerplate code, and yes, using UIKit needs more of that, but most of it in my apps is written-once-use-anywhere in class extensions or even UIKit sub-classes that I've made. (the latter is one of the advantages of using Object Oriented programming, you haven't got this flexibility with SwiftUI because it is based on structs instead of classes) So, in the end because of extensions and sub-classes, my apps are relatively small and run great even on the older devices. No problem. In summary, in this perspective, to get a job as iOS developer, it is very important to master UIKit because at many companies, SwiftUI cannot be deployed, simply because it is not available in older iOS devices that need to be supported. There is a social aspect to this too, think about it, e.g. maybe you have (grand)parents who are happy with their older iPads and iPhones. so restricting or upgrading your apps to a higher iOS version counts them out.
Great Video and loved the comparison but... Most developers would have used Autolayout in storyboard to create that app prior to UIKit. would that have been the faster approach?
I think you’d be surprised at the percentage of UI in the top chart apps that is not storyboard based. There are trade offs between code and storyboards, and the larger the team and longer lived the app, the worse storyboards look. That’s a big part of why swiftui is so exciting, we can finally use interface builder without most of the downsides.
My question is why not comparing the time taken with story board? Its not an illegal way of building apps 🧐. Its like you are asking a moter bike not to start its engine and race with a foot cycle 🤦🏾♂️
This is amazing on so many levels. Having bumped into your channel has been a great thing. Thanks lot for these. Had a question, was checking your Gumroad and for a complete beginner on Swift (but not so much on programming, I mostly do C# and shaders) which pack should I begging with? Power Pack or Plus Pack? Cheers.
Great video, although i feel it was not very fair to UIKit. It has storyboards and it is a greate advantage, if we had done all the code in storyboard - it would have taken equal time to SwiftU, and code lines would have been shorter. I love storyboards and do not code programmatically much, so maybe i am biased. But storyboards make creating UI super fast, in fact at first i found it faster than SwiftUI.
I really appreciate the effort and detail in this comparison but it’s not a fair test. UiKit’s auto-layout is horrendously complicated because it’s so flexible. But it’s intended to be done in IB with code as the fallback. Surely a better test is do UIKit in IB vs SwiftUI?
I'm planning to move to Canada from Africa, I want to know which market dominates there between iOS native development vs Flutter cross platform development?
Excellent. I think, I am very good with XAML, but I can estimate, it will take me, about 1 hour (may be more) to do the same app on UWP. Nothing wrong with XAML or UWP, it is you, you are much better than me. Ha. Thank you!
the course I bought is ios app development - angela yu from udemy and it is based on xcode 12 (when ui kit was still used) but this is 2023 and xcode is ont having uikit option we create a file based on swift ui, what should I do ??? please help
This is awesome. Quick question, do you need to have a particular Swift or Xcode version to use SwiftUI? Like Swift 5? My current codebase is Swift 4.2 but I'd love to use it.
Ali Aljoubory you need the Xcode beta, which runs on Catalina beta, and you can only target iOS 13 or higher. I’m not sure wether Swift 5 is required but it’s set by default for new projects.
It’s required xcode 11, swift 5.1 and iOS 13 to run. I think it’s too early to make production apps with swift ui, because there will be still users with iOS 12 in next 1-2 years
The layout part that wasted most of the time for the UIKit version was done wrong, you don't need to use stacks, in fact stacks makes it harder. You can do it very quickly in many ways, I can do the entire constraints of that view with just 5 lines of code using constraintsWithVisualFormat. Anyway, "faster" or "less code" is not a suitable measure of how good something is. When it comes to code, you might have to spend more time at some point, but it saves you time later.
Question: If I'm jumping into iOS programming, and I am using the Stanford 2020 SwiftUI class (on the multithreading lecture now) ... am I doing well, or should I have backed up and learned UIKit / Storyboarding first ? Curious as to your opinion
great video...im still in the UIKit camp for now. my question is... will all the big companies adapt to SwiftUI or stick with UIKit? i still think when going for jobs for the next few years, building out an app in code using UIKit is still going to get you job over SwiftUI.
i never use uikit without interface builder. so all of coding the interface is simply do not exists in my workflow. if i need a custom ui element sure i can code that but after coding over i use that new uielement inside of interface builder. and i use a storyboard for every viewcontroller and it works great and clean. without interface builder swiftui will not replace uikit. for people who do not use ib and code every ui element sure it is great. but without interface builder this is simply is much more code. and i do not want code more.
I agree. A comparison to UIKit without IB is like competing in a race blindfolded. If he used IB the UIKit workflow would have been ridiculously faster.
SwiftUI won but you had to purposely make uiKit take longer by doing it programmatically. Not sure why you did that if the goal was to see which one was faster...
"Lots of boiler plate code for UIKit". Yes, that is because you didn't fully leverage the storyboard. This whole in-code approach is a waste of time. You could have done all the autolayout etc, detail controller etc much faster using the storyboard. So a bit of an apples and oranges comparison. The UIKit version could be much faster.
Just wondering, on UIKit we usually load asynchronous data on ViewDidLoad or ViewWillAppear. How we do it on SwiftUI? On init? or introduce another method ( like load data, and somehow reload the UI once the data is loaded )
True but not sure it will be the same while handling datas manipulation and complex actions. SwiftUI is great to design screen but when you try to manipulate datas its need a lot of thinking.
Depends on what you want to do. SwiftUI is amazingly fast and easy to use, but it is definitely missing some features. For instance, if you want to do something like, say, move a textbox up above the keyboard when typing, that isn't something you can do with SwiftUI yet. SwiftUI also doesn't support a lot of elements like WebViews. Additionally, SwiftUI only supports iOS 13, so if you're planning on actually distributing an app, it shouldn't be used as a complete replacement for UIKit yet. Therefore, I'd recommend learning UIKit (at least the basics) as well as SwiftUI, since the two are interoperable. That way, you can create most of the stuff you need in SwiftUI which makes things a lot easier, and if you want any of those advanced features only in UIKit, you can embed them into SwiftUI (and vice versa).
Hi Paul I’m playing with SwiftUI wright now. And I have a question to you about the WabKit: import SwiftUI import WebKit struct WebView : UIViewRepresentable { let request: URLRequest func makeUIView(context: Context) -> WKWebView { return WKWebView() } func updateUIView(_ uiView: WKWebView, context: Context) { uiView.load(request) } } struct webView_Previews: PreviewProvider { static var previews: some View { WebView(request: URLRequest(url: URL(string: "www.apple.com")!)) } } //All works. But keyboard is not appearing when it needs. If you have any solutions it will be great! Thank you!!
Why would anyone use UI kit to hand code the design in the first place ?! That’s counter productive and against the basic functionality of the product.
Some reasons I'm strongly in favour of hand coding the design: - Storyboards/Xibs are XML files. Have you seen the conflicts on those things? Also, reviewing pull requests that change them is massive PIA. - There is no way to define a constant for your colors, padding, font. Good luck updating your branding. - Reusing components is a massive PIA. If you need the same collection view cell on 2 view controllers, you need need to create a Xib for it and do half the work in code. - Simply opening Storyboards/Xibs files in a different version of Xcode generates 5-10 lines of changes. - If you make a typo in Interface Builder, you get errors at runtime. If you make a typo in code, you get an error at compile time - With interface builder, you need to use implicitly unwrapped optionals. If you forgot to link that IBOutlet, enjoy your crash at runtime. Yes, you do it 2-5x faster in interface builder, but you pay that heavily in maintenance cost later.
@@Ascentyon Excellent points ! More the reason why the UIKit must evolve to rectify the shortcomings or the whole design platform needs a better workflow. Perhaps the Swift UI is a step in that direction. Wouldn't you agree that approach to design is best designed and not coded - visually - WYSIWYG ?!
The side-by-side comparison is great! Felt like it was a director's commentary or a sportscaster narrating what was happening in the game.
This is fantastic and I LOVE the side by side comparison. PLEASE do more of these side by side videos!!!!
You are doing amazing work Paul. Keep rocking !
Watching this at the end of 2023, I can say I have no need to learn UIKit with SwiftUI. I come from a ReactJS background and learning SwiftUI just made a lot more sense given it's declarative nature and less boilerplate code. Very happy to learn SwiftUI it's so far so good.
I am new to swift and this is great advice. Never knew what they were until now
Your videos are so good I’ve bought your book and now I watch and click on all the ads on your videos to make sure that you get every last cent out of the advertisers. You deserve it!
I would really like to see a similar video comparing UIKit (with Storyboard) compared to SwiftUI. I really appreciate this video though!! I’m finding the switch from UIKit to SwiftUI to be EXTREMELY difficult though honestly... It seems so difficult to write clean code using SwiftUI
Mate, this is funnier than expected! You make UIKit look like an old timer :) This video definitely convinced me to move into SwiftUI prototyping as honestly I've got completely cluttered into Storyboards and ViewControllers mixed with code and seques and all of that ... just to build the prototype for development... :)
Great comparison but I HIGHLY enjoy that kind of video template. I hope I'll see more video-templates like that from you, where the coding is done quite fast and you comment stuff in real time with pause breaks. Great way to keep video relatively short, busy millennials like me really appreciate this ! :)
I’m learning Swift as a hobby. I use Interface Builder instead of coding with UI kit. It’s intimidating to see that I will have to learn how to programmatically make a UI. Your videos help me so much and help me gain experience in Swift too. Thank you.
I wish many people using this side by side way of comparing frameworks, it's very helpful when one wants to decide on which to use. Thanks +Paul Hudson
Thanks Paul for this great video! I actually started to use SwiftUI on my main project couple of months ago and I'm mostly satisfied except for one problem which is backward compatibility. Many great features of SwiftUI today are exclusively available for iOS 15 which makes me feel that I should've waited for a year or two not to get new features but to only use the existing ones while being able to support at least two major versions of iOS
if you are comparing both the framework and time to achieve the specific milestone , you should have chosen the fastest way for implement UIKIT which is through storyboard then we could call it a fair comparison .. by this time , this comparison is not fair .. we can achieve these milestones in much quicker way in UIKit by using Storyboard , outlets , actions etc
Btw i like the way you are comparing frameworks
Also, one could use awesome github repos like TinyConstraints in making layout super fast. The main difference between SwiftUI and UIKit is not how fast you can build apps, but how to approach building apps. This has also been said by Paul in numerous other videos of his.
as we create a new project, we are choosing to use SwiftUI or Storyboard, not UIKit... so i would say, if we know how to use storyboard very well, it might not be slower than using swiftui
Cool! Having three instances of Paul might make it even better: one working with and advocating/apologizing for UIKit, one working with and advocating/apologizing for SwiftUI, and one moderating.
Side by side comparison is a really cool idea! Thank you for you work, Paul 🙏 You are amazing!
I’m speechless this was so enjoyable, so much better than my university lecturer.
with the advent of the Corona virus traditional schooling will die (at least that's my hope)
Thanks Paul, very informative. I'm starting out with IOS development and I needed to know what I am getting myself into. You simply made things easier for me. I truly appreciate you.
“Hacking with SwiftUI” will be best series on RUclips !
This was amazing! Loved the comparison, and it’s great to still show that UIKit still has the power to make iOS apps. It’s gonna be with us a lot more, until SwiftUI gets the power to compete with UIKit in bigger projects. 😉
I'm pretty sure this was faster constructed in Interface Builder. Having both projects finished around 9 minutes.
I wrote an app to be used within the company I work for and was stunned of how quickly I a managed to write the app in SwiftUI including having to fetch a JSON from my API. But I agree I am still working with both UIKit and SwiftUI.
I'm not sure how valid this is, usually you use SnapKit or some extensions for constraints, but also you choose app format where SwiftUI really shines. Anyway nice comparison, thank you.
Thanks, Paul! This was a good comparisson for these two frameworks. I will stay at UIKit, but SwiftUI is definetely a good way for building new Apps with limited functionality quickly.
Yeah but where is today Objective C ? So that far will go UIKit to will disappear as well just like Objective C so UI Swift will be taking he's place very Soon
@@raitasorin Not that soon, i suspect that another 2 solid years uikit will still be top. Then slowly fade away. The swiftui will need at least 2-3 years to mature at the point where you can make a real complex app. UIKIT is here for 10 years now...
Awesome video. It's so cool how the SwiftUI code can run on all Apple devices with some minor adjustments.
Guitaripod not my iPhone 6...
staybalanced it’s time to move on from 2013 my friend
Guitaripod give me one good reason of a feature to upgrade. I haven’t been moved to get a new phone new features seem more like gimmicks
@@staybalancedn You already answered your own question 😸
@@guitaripod iOS 13 still has quite a few awful glitches.
Forcing people to dispose a working device for sake of new way of arranging views in the editor is kind of a weak excuse.
It's not revolutionary either. React Native goes with this concept a bit better: more forgiving view state management, stylesheets, etc.
I have new devices for testing, but iPhone 6 is still more usable, even after I bought lightning-audio-data port adapter. TBH, newer iPads have sidecar option and apple pencil. First one is slightly glitchy, but second one is a killer option (both in terms of usability and price)
Super cool demo. But I feel it’s not exactly fair to do all the layout in code for uikit. I’m a believer in doing that in the visual editor. Wouldn’t most people do it that way?
Wow, amazing that you programmed it that quick.
As you said, UIKit and SwiftUI cannot easily be compared. For instance I'd usually create a xib file for the detailview just to make the layout with all the constrains using the interface builder. This is because the constrains in code are so ugly and take a lot of time to write. Now in SwiftUI constrains aren't a thing anymore and create elements by code is made a lot easier. So it's still not completely fair to write everything in code and time it. Then of course SwiftUI will be better.
Just found this channel, and I'm loving it.
Hi, thanks a lot. What is yours opinion about start learning SwiftUI in 2023? Or you strongly recommend to learn UIKit as well?
Ouh mate i can't denied how that Beautiful and shiny was ! I love that Bro well done, please stay more around The Blue Planet
swiftui is cool, but it still has 2 years till it's gonna be used in production
Not fair at all, there is no need to create detail view controller in code, you can just drag and drop UI controls on storyboard and create whole screen easy. This would for sure reduce lines of code for UIKit, and I think you did it on purpose this way. I don't say UIKit is better, or that SwiftUI is better, just that this was not good enough comparison.
Thanks you for your videos to help us to learn swift. Have nice Christmas.
Take a moment to notice how SwiftUI introduces multiple levels of abstraction with extra `UIViews`, while UIKit keeps the view hierarchy looking neat and simple. 🎉
Really inspiration video for me. As react native developer,I don't know about it much. I want to know the SwfitKit and UIKit. Your video made me clear. Thank you.
great video Paul! However, I think that with swiftUI (for the time being) it's a bit harder to make a really custom UI - currently we are using here basic UIKit ported elements. What you think? SwiftUI is more concise, no boilerplate code. Don't get me wrong, I am currently hesitating to start build a complex UI with SwiftUI.
SwiftUI is still the new kid on the block, but when a UI component is missing one can always use the UIKIt version of it with UIViewControllerRepresentable
I wonder if UIKit would be quicker if you use storyboard to define the layout rather than doing it programmatically?
Why didn't you use a storyboard on your StarshipViewController and just pass around the values? Although sometimes buggy, I think the storyboarding is one of the strengths of UIKit
I love your videos... I know I'm late to respond but to be honest, I would rather like to see a video comparing the headaches involved in trying to figure something out that is not working as expected and the time it takes googling or jumping into the documentation for solutions. I think in that case, SwiftUI development might be slower (but that's just me).
Why, in the UIKit version did you need to add a wrapper view to inset the text? Why not just set a width constraint on the label?
I imagine to do it properly with display scaling
This is a great video comparing the two platforms, amazing... thanks for this...
Would it be less lines of code and, probably, much faster with using storyboard for UIKit (outlets, view composing, segues, etc) ?
of course.
Yes and that's why I think it's not really a fair comparison. UIKit is meant to be "meant to be" used with the storyboard to set stuff up and then programmatically tweak it a bit. I think it would have finished very close if not faster.
@@punishedbrains9954 Using SwiftUI ist much faster then Storyboards and UIkit. Example: Try setting up a table with Storyboard. You will have to add it to Storyboard, add a cell, design the cell. Then drag everything into your view controller. Then add the delegates, and delegate methods, then implement the code to tell the table how to deal with the data, which you will also have to implement.
Now compare all this with how it works in SwiftUI: Just wrap whatever content you would like to have in a cell in "List(){..}". Finish. ^^Thats it. No Protocols, methods, data, etc.
@@Seitenwerk except when your table starts to grow immensely. Or if you'll need to perform animated edits to the table. Or if you need just to scroll somewhere in the list. Or basically anything other than a flashy demo.
I think SwiftUI has giant potential but it's still just a tool for quick prototyping
@@Seitenwerk Really? With a simple right click you assign the delegates. And the methods of the tables I have them in a snippet
Paul, I did not know these features like customSpacing for stackView and fast coding in UIKit. I am tired so much of spacing in stackView, thanks for that method a lot!
Nice comparison! I use the containerView trick with stackViews all the time. lol!
Compatibility.
Unfortunately SwiftUI is only available for iOS 13.0 and higher.
Using SwiftUI would thus mean that you can no longer support people with older devices.
There are still millions of iOS devices out there with iOS versions older than iOS 13, and are no longer be updated because Apple (policy) does not supply updates for this older devices.
Take, for example, a banking application with millions of users. Of course, as a bank, you must support as many devices as possible, even those that are bought a long time ago. These are your customers, were you are depending on, whether rich or living on a small budget.
Note that for a lot of people, iPads and iPhones are relatively expensive devices. if you live on a small pension budget, in many cases you can't even afford to replace your iPad or iPhone There are millions out there that can't.
That is why I make my apps available starting with iOS 9. Unless special features only available in later iOS versions are needed e.g. like AR. I have absolutely no problem with targeting starting with an old iOS version. (but maybe Apple has, because from a commercial point of view of a hardware seller, it is more profitable to "encourage" people to replace their devices as soon as possible. However, I wouldn't go that far to say that Apple is introducing new tools like SwiftUI all the time for that very reason..)
Using UIKit is not so hard as it might look for beginners, especially when using a language like Swift.
Paul, you're talking about a lot of boilerplate code, and yes, using UIKit needs more of that, but most of it in my apps is written-once-use-anywhere in class extensions or even UIKit sub-classes that I've made.
(the latter is one of the advantages of using Object Oriented programming, you haven't got this flexibility with SwiftUI because it is based on structs instead of classes) So, in the end because of extensions and sub-classes, my apps are relatively small and run great even on the older devices. No problem.
In summary, in this perspective, to get a job as iOS developer, it is very important to master UIKit because at many companies, SwiftUI cannot be deployed, simply because it is not available in older iOS devices that need to be supported.
There is a social aspect to this too, think about it, e.g. maybe you have (grand)parents who are happy with their older iPads and iPhones. so restricting or upgrading your apps to a higher iOS version counts them out.
Very helpful and insightful comment. Thank you
Thanks for a great video! I'm curious, which you did first - UIKit or SwiftUI version?
Great Video and loved the comparison but... Most developers would have used Autolayout in storyboard to create that app prior to UIKit. would that have been the faster approach?
I meant to say prior to SwiftUI not prior to UIKit
@@Glassip It's NOT "always more clear to have everything in code"… that's purely your opinion .
I think you’d be surprised at the percentage of UI in the top chart apps that is not storyboard based. There are trade offs between code and storyboards, and the larger the team and longer lived the app, the worse storyboards look. That’s a big part of why swiftui is so exciting, we can finally use interface builder without most of the downsides.
My question is why not comparing the time taken with story board? Its not an illegal way of building apps 🧐. Its like you are asking a moter bike not to start its engine and race with a foot cycle 🤦🏾♂️
Great work!! Loved the side by side comparison.
Paul is your opinion about UIKit is still relevant by 2023?
This is amazing on so many levels. Having bumped into your channel has been a great thing.
Thanks lot for these.
Had a question, was checking your Gumroad and for a complete beginner on Swift (but not so much on programming, I mostly do C# and shaders) which pack should I begging with? Power Pack or Plus Pack?
Cheers.
Definitely the Power Pack, but save your money and follow my free 100 Days of SwiftUI first: hackingwithswift.com/100/swiftui
Fantastic idea for a video, Paul!
Can you show the side by side of keyboard tabbing from one text field to another as is done easily in UIKit and unknown in SwiftUI?
It's so clear! Thank you so much! Great job.
Great video, although i feel it was not very fair to UIKit. It has storyboards and it is a greate advantage, if we had done all the code in storyboard - it would have taken equal time to SwiftU, and code lines would have been shorter. I love storyboards and do not code programmatically much, so maybe i am biased. But storyboards make creating UI super fast, in fact at first i found it faster than SwiftUI.
what was the real time without speedup? only detail I am missing, nice work overall!
I really appreciate the effort and detail in this comparison but it’s not a fair test.
UiKit’s auto-layout is horrendously complicated because it’s so flexible. But it’s intended to be done in IB with code as the fallback. Surely a better test is do UIKit in IB vs SwiftUI?
I'm planning to move to Canada from Africa, I want to know which market dominates there between iOS native development vs Flutter cross platform development?
Hey Paul, can we get a tutorial more slowly explained as well?
Excellent.
I think, I am very good with XAML, but I can estimate, it will take me, about 1 hour (may be more) to do the same app on UWP.
Nothing wrong with XAML or UWP, it is you, you are much better than me. Ha.
Thank you!
As ever, hugely helpful and informative - thank you Paul.
the course I bought is ios app development - angela yu from udemy and it is based on xcode 12 (when ui kit was still used) but this is 2023 and xcode is ont having uikit option we create a file based on swift ui, what should I do ??? please help
This is awesome. Quick question, do you need to have a particular Swift or Xcode version to use SwiftUI? Like Swift 5? My current codebase is Swift 4.2 but I'd love to use it.
Ali Aljoubory you need the Xcode beta, which runs on Catalina beta, and you can only target iOS 13 or higher. I’m not sure wether Swift 5 is required but it’s set by default for new projects.
It’s required xcode 11, swift 5.1 and iOS 13 to run. I think it’s too early to make production apps with swift ui, because there will be still users with iOS 12 in next 1-2 years
Thank you very much, don’t you think that using UiKit with storyboards will make things a lot faster ?
Also using layout frameworks for doing layout is much faster way to go
Jeffrey Haines after five months of using SwiftUI I'm regretting my original comment 😂 SwiftUI is way better
Amazing! Thanks Paul. Are any of these projects in your github?
The layout part that wasted most of the time for the UIKit version was done wrong, you don't need to use stacks, in fact stacks makes it harder. You can do it very quickly in many ways, I can do the entire constraints of that view with just 5 lines of code using constraintsWithVisualFormat.
Anyway, "faster" or "less code" is not a suitable measure of how good something is. When it comes to code, you might have to spend more time at some point, but it saves you time later.
Question: If I'm jumping into iOS programming, and I am using the Stanford 2020 SwiftUI class (on the multithreading lecture now) ... am I doing well, or should I have backed up and learned UIKit / Storyboarding first ? Curious as to your opinion
Another great video. Thanks, Paul!
I subbed because of this video. Super helpful. Thanks so much.
great video...im still in the UIKit camp for now. my question is... will all the big companies adapt to SwiftUI or stick with UIKit? i still think when going for jobs for the next few years, building out an app in code using UIKit is still going to get you job over SwiftUI.
I think that'll depend on how fast SwiftUI will adopt.
I think you should make the second vc in storyboard and then compare.
i never use uikit without interface builder. so all of coding the interface is simply do not exists in my workflow. if i need a custom ui element sure i can code that but after coding over i use that new uielement inside of interface builder. and i use a storyboard for every viewcontroller and it works great and clean. without interface builder swiftui will not replace uikit. for people who do not use ib and code every ui element sure it is great. but without interface builder this is simply is much more code. and i do not want code more.
I agree. A comparison to UIKit without IB is like competing in a race blindfolded. If he used IB the UIKit workflow would have been ridiculously faster.
Thanks.
What about memory footprint and performance?
What about next 4 years time? Will Swift ui be the norm in 4 years?
SwiftUI won but you had to purposely make uiKit take longer by doing it programmatically.
Not sure why you did that if the goal was to see which one was faster...
Excellent video. Thanks! Just subbed.
That was Great Toturial easy comparison.
Can you upload this project please?
Thanks for the info and for these examples!
"Lots of boiler plate code for UIKit". Yes, that is because you didn't fully leverage the storyboard. This whole in-code approach is a waste of time. You could have done all the autolayout etc, detail controller etc much faster using the storyboard. So a bit of an apples and oranges comparison. The UIKit version could be much faster.
Drew McCormack agree 👍
I agree, he could have done this app in UIKit within 9min too and less line of code then SwiftUI if he used properly the storyboard.
Storyboard is less maintainable than code so it does not make sense to use it
Great! Thank you very much 🙂
How about a mixed one? Using swift together with swiftUI
Nice but I’d rather have used storyboards and xibs for this kind of comparison
Just wondering, on UIKit we usually load asynchronous data on ViewDidLoad or ViewWillAppear. How we do it on SwiftUI? On init? or introduce another method ( like load data, and somehow reload the UI once the data is loaded )
i just found out from your others video, that we can use @State for this case. Can’t wait to try it out
Great work Paul !!! Thank you.
UIKit ‘in code’ is not a fair comparison lol this would be trivial to make in interface builder, almost no code at all required
Finally a rational comparison. Thank you! Is a download available ?
True but not sure it will be the same while handling datas manipulation and complex actions. SwiftUI is great to design screen but when you try to manipulate datas its need a lot of thinking.
As a complete novice wanting to learn iOS programming which platform do you recommend to get the basics correct ?
Depends on what you want to do. SwiftUI is amazingly fast and easy to use, but it is definitely missing some features. For instance, if you want to do something like, say, move a textbox up above the keyboard when typing, that isn't something you can do with SwiftUI yet. SwiftUI also doesn't support a lot of elements like WebViews. Additionally, SwiftUI only supports iOS 13, so if you're planning on actually distributing an app, it shouldn't be used as a complete replacement for UIKit yet. Therefore, I'd recommend learning UIKit (at least the basics) as well as SwiftUI, since the two are interoperable. That way, you can create most of the stuff you need in SwiftUI which makes things a lot easier, and if you want any of those advanced features only in UIKit, you can embed them into SwiftUI (and vice versa).
Hi Paul
I’m playing with SwiftUI wright now. And I have a question to you about the WabKit:
import SwiftUI
import WebKit
struct WebView : UIViewRepresentable {
let request: URLRequest
func makeUIView(context: Context) -> WKWebView {
return WKWebView()
}
func updateUIView(_ uiView: WKWebView, context: Context) {
uiView.load(request)
}
}
struct webView_Previews: PreviewProvider {
static var previews: some View {
WebView(request: URLRequest(url: URL(string: "www.apple.com")!))
}
}
//All works. But keyboard is not appearing when it needs. If you have any solutions it will be great! Thank you!!
Excellent video! Thank you
Can you do one addressing translating a UITextView for text entry into SwiftUI?
Gratitude...Gratitude... Gratitude... All Best in your own Great Way
Sir how can i pick videos like in image picker SwiftUI
Why would anyone use UI kit to hand code the design in the first place ?! That’s counter productive and against the basic functionality of the product.
Some reasons I'm strongly in favour of hand coding the design:
- Storyboards/Xibs are XML files. Have you seen the conflicts on those things? Also, reviewing pull requests that change them is massive PIA.
- There is no way to define a constant for your colors, padding, font. Good luck updating your branding.
- Reusing components is a massive PIA. If you need the same collection view cell on 2 view controllers, you need need to create a Xib for it and do half the work in code.
- Simply opening Storyboards/Xibs files in a different version of Xcode generates 5-10 lines of changes.
- If you make a typo in Interface Builder, you get errors at runtime. If you make a typo in code, you get an error at compile time
- With interface builder, you need to use implicitly unwrapped optionals. If you forgot to link that IBOutlet, enjoy your crash at runtime.
Yes, you do it 2-5x faster in interface builder, but you pay that heavily in maintenance cost later.
@@Ascentyon Excellent points ! More the reason why the UIKit must evolve to rectify the shortcomings or the whole design platform needs a better workflow. Perhaps the Swift UI is a step in that direction. Wouldn't you agree that approach to design is best designed and not coded - visually - WYSIWYG ?!
@@Ascentyon Fake, after 3 months without touching the Swift UI code this will look Chinese to you.
hi, is there a link to the code examples? thanks
Thank you !!
I like the simplicity of SwiftUI but it’s still a very buggy framework as far as I observed within one week of using it
So we can't use both UIKit and SwiftUI in the same project? It has to be one or the other?
Both can be used in the same project. It looks like SwiftUI will only be supported on iOS 13 and MacOS Catalina though.