Storyboard vs Code - Why I use Storyboards

  Переглядів 35,376

CodeWithChris

CodeWithChris

День тому

Wondering if you should build your UI with storyboards vs programmatically? I’ll tell you when it’s better to use interface builder and storyboards and when it’s better to use code to build your user interface.
Most of the articles I’ve read on this topic lean heavily towards doing everything programmatically while bashing storyboards.
In actual fact, it’s a pretty evenly divided between the two methods. Paul Hudson recently tweeted a poll and I was pretty surprised by how close the results were!
So if you’re wondering which is better: storyboards vs code in Swift, then let me settle the debate for you once and for all!
Links mentioned in the video:
Brian Voong - Storyboards vs Code: Which is faster?
• Storyboard vs Code Spe...
Sean Allen - Skeletal Storyboards
• Xcode 10 - Interface B...
Get a customized roadmap for your app and start building it in 7 days:
⚡codewithchris.com/actionplan
My guide for Xcode on Windows:
💻codewithchris.com/xcode-for-w...
New to app development?
Check out my step by step beginner series right here (no programming experience required!):
🎞 • How to Make an App for...
This video series will teach a beginner how to code and make apps. These videos assume that the student has no prior coding knowledge and is starting from scratch.
Need motivation?
Here's just a sample of the success stories my students have sent in:
👩‍💻 codewithchris.com/success-sto...
For more tutorials on how to build iPhone apps, make sure you subscribe and visit my site where you'll find a community of like minded learners! Learning something new is always more fun with other people!
Website: codewithchris.com
Twitter: / codewithchris
Community: codewithchris.com/community
Instagram: / codewithchris
CodeWithChris is dedicated to teaching beginners and non-programmers all about how to make an app. On the site, you'll find a ton of free resources and tutorials to aid you on your journey to learn iOS development. Many people have successfully picked up Swift 4, Xcode 10 and app building from my course and materials!
About this video:
The debate on storyboards or code for your UI has always been a hot one. In this video, I’ll share why I was a huge advocate of building your UI programmatically but now, I’m a huge fan of using Interface Builder and storyboards in Xcode.
#CodeWithChris #TeamStoryboard #TeamCodeUI

КОМЕНТАРІ: 92
@CodeWithChris
@CodeWithChris 5 років тому
QOTD ⚡Do you prefer storyboards or the programmatic approach? Let me know below!👇 Kick start your own app with my free 7 Day App Action Plan ➡️ bit.ly/7dplan
@maximobriggs8499
@maximobriggs8499 2 роки тому
A trick : watch series at flixzone. Been using it for watching loads of movies lately.
@seanallen
@seanallen 5 років тому
Well said, Chris. And thanks for mentioning my Skeletal Storyboard approach!
@CodeWithChris
@CodeWithChris 5 років тому
Thanks for taking the time to watch and comment, Sean! Much appreciated!
@LetsBuildThatApp
@LetsBuildThatApp 5 років тому
Yeah I think over the years the viewers on my channel are asking for even more and more advanced topics. I would also go crazy if I had to teach how to lay out buttons and tableviews again. Great to have a wide spectrum of available content nowadays.
@CodeWithChris
@CodeWithChris 5 років тому
Yeah! I always send people your way who want to learn the tougher stuff! :)
@johniiibibal8838
@johniiibibal8838 5 років тому
Holy crap, that last slide (with the recommendations) was hella enlightening. Thanks Chris!
@mehdiabdi3773
@mehdiabdi3773 5 років тому
WoW That Was Different !!! Good Job Chris💙
@Luism-tz2ey
@Luism-tz2ey 4 роки тому
chris thanks for sharing your knowledge!!
@CodeWithChris
@CodeWithChris 4 роки тому
Welcome! Thanks for the support! Kat
@alimkuprianov3294
@alimkuprianov3294 3 роки тому
Finally, someone has answered this question wisely, my thanks)
@CodeWithChris
@CodeWithChris 3 роки тому
You're so welcome! -Arthur
@applepie7282
@applepie7282 4 роки тому
thanks Chris. programmatic ui is inevitable at the end of the day. If you're an absolute beginner, I think you should also consider swiftUI as well as the storyboard approach nowadays
@CodeWithChris
@CodeWithChris 4 роки тому
Hello, yes i think so as well in the future maybe swiftUI may be more dominant for "cross-platform" support, i think storyboard still has a long lifespan though and will not end anytime soon - Francis
@scottcartwright9008
@scottcartwright9008 5 років тому
Great video
@mrdavidrees
@mrdavidrees 5 років тому
Xibs are the greatest- it will fix all your slow storyboard problems. One screen xib for one viewcontroller.
@followerOfJesus723
@followerOfJesus723 5 років тому
I agree with this video 100% 👍🏾 👍🏾 👍🏾 👍🏾 👍🏾 👍🏾 👍🏾 👍🏾
@MrIMacro
@MrIMacro 3 роки тому
Thank you so much Chris, but in your latest videos you are encouraging people to use swiftUI !! so did you change your mind? thank you so much.
@CodeWithChris
@CodeWithChris 3 роки тому
Yup, we are now producing more SwiftUI videos. But UIKit is important too!
@ljukicar
@ljukicar 5 років тому
Bravo Chris👍👍👍
@CodeWithChris
@CodeWithChris 5 років тому
Thank you! @AdrienVillez
@EduardoMoll7
@EduardoMoll7 5 років тому
I think is depends on what you trying to do. I love storyboards but I also like doing it programmatically. Sometimes we want to do dependency injection in an initializer and init from nibs won't let you do that and like you said storyboards should be broken down or else they would be a mess to work in a team environment.
@CodeWithChris
@CodeWithChris 5 років тому
A man talking from experience! Thanks for your input! @AdrienVillez
@user-vg2eq8ud9q
@user-vg2eq8ud9q 2 роки тому
Hi, Chris. Thanks for this video! I'm a college student with programming skills and I'm interested in macOS coded UI development. Could you please give me some advice about where to start? Or some recommended tutorials?
@user-vg2eq8ud9q
@user-vg2eq8ud9q 2 роки тому
I don't really like Storyboard. And it seems that on macOS, SwiftUI is still weak to achieve full functions.
@CodeWithChris
@CodeWithChris 2 роки тому
"Hello, sadly we don't cover MacOS programming.. I think SwiftUI would be the better choice though because it would also make your app available on all platforms (phone, tablet, macOS), we recently just updated our course to full SwiftUI so maybe give a look at what we have to offer and see if you are interested.. head over to learn.codewithchris.com to know more about our paid membership and the courses - Francis"
@diegoromero1927
@diegoromero1927 2 роки тому
Hey Chris, quick question if I were to build one part with story board and another part programmatically can I connect the two in story board or not?
@CodeWithChris
@CodeWithChris 2 роки тому
Hello, kindly post your question in our CodeCrew forum so that our technical support staff there can assist you. Go here: codecrew.codewithchris.com. Thanks for learning with us! -Arthur
@tenzinmahabir4669
@tenzinmahabir4669 3 роки тому
Hi Chris, I have 3+ years programming experience with Java, C and Python but I am new to Swift and I am wanting to build my first iOS app. In my case, do you suggest I build my app using programmatic UI? If so, does that mean I use swiftUI or is there another way to build an app in Xcode programmatically...because I understand that since SwiftUI is fairly new, it does not have a lot of resources at this time. Thus, I am not sure if SwiftUI is the way to go or not.
@CodeWithChris
@CodeWithChris 3 роки тому
Hello, although swiftUI is new it will probably have more resources as time goes by especially because there is a lot of interest for it, it is also possible to do programatic UI in normal Swift storyboard but if you are using storyboard then its best to utilize the storyboard - Francis
@tenzinmahabir4669
@tenzinmahabir4669 3 роки тому
CodeWithChris Thanks for replying, I have some other questions if you don’t mind answering :) 1) Aside from using SwiftUI, what are other ways of making programmatic UI? 2) Is SwiftUI the superior way to design a UI in general and programmatically?
@rgenericson5361
@rgenericson5361 4 роки тому
Very cool!
@CodeWithChris
@CodeWithChris 4 роки тому
Thank you! - Kat
@gjermundification
@gjermundification 5 років тому
4:20 XCode 3 or 10 regardless; here is my 2 cents: everyone should write UI programmatically to learn; then use Storyboard to improve communication in teams. Note some parts have to be done programmatically no matter what. Skeletal Storyboards FTW^^
@imacg5658
@imacg5658 3 роки тому
When I built my 1st app, an app that calculates the amount of money you spend on 1/2 sheet cakes at either Walmart, Costco, or Target, Making a proper menu, about page and the UI itself was so easy in Interface Builder. I made it in 30 mins. I attempted doing it in SwiftUI code, but I always fell flat. I have decent experience with Python, but wow, IB is so much better for me.
@CodeWithChris
@CodeWithChris 3 роки тому
Thanks for sharing!! - Kat
@imacg5658
@imacg5658 3 роки тому
CodeWithChris You’re welcome! I just wanted to share what method worked best for me!
@developer-juice-Khailenno
@developer-juice-Khailenno 3 роки тому
Alright I like this argument. however using xibs and multiple story boards, can this be an option for an advanced dev teams? im talking about intermediate and senior devs.
@CodeWithChris
@CodeWithChris 3 роки тому
"Hello, storyboard should be fine even if its a big team as long as only a few people manage the storyboard, but for that case i think it would be better to just build the UI programmatically to have better control and ownership, might i also suggest going SwiftUI to make it more up to date and easier - Francis"
@DoubleCheapBurger
@DoubleCheapBurger 3 роки тому
5:38 Oh my god! That was literally me first year at college with C programming LOL. Brought some flashbacks.
@CodeWithChris
@CodeWithChris 3 роки тому
Haha! But look at where you are now! :-) -Arthur
@maxbudnik
@maxbudnik 5 років тому
In my opinion - use the storyboard for MVP or small project. If project is too large and you are work in team use xib and programming UI in code.
@CodeWithChris
@CodeWithChris 5 років тому
Agree! @AdrienVillez
@greyd
@greyd 2 роки тому
so if we decide to go with storyboard option we can not change it back ? or have both options anytime we want ?
@greyd
@greyd 2 роки тому
as a noob i am trying to understand but it feels like so if i choose storyboard will it all be just plug & play without serious coding experience? plus if we choose story board isnt it going to show the programitacly version on the side at the end or something ?
@CodeWithChris
@CodeWithChris 2 роки тому
You can go back and forth, it's easier to go from a Storyboard to a coded UI app tho. When you go to File >> New, you can to create ay kind of files you want, even a new storyboard. You just need to link everything accordingly. For example, if you delete or decide to not use a storyboard anymore, you have to disconnect all your IBOutlet and create + connect them via code instead. As a beginner, I would suggest to stick to one method first, learn how everything works, then start to juggle around. Also, SwiftUI is the new kid on the block, check out our newest playlist. @AdrienVillez
@WiggglezMr
@WiggglezMr 3 роки тому
SwiftUI, this needs a revisit. there is "Button" now for code and view stacks.
@CodeWithChris
@CodeWithChris 3 роки тому
Thanks for pointing that out, Tyler!
@SuperMIKEBIKE1
@SuperMIKEBIKE1 Рік тому
Chris is it possible to create a UIPicker View not using storyboard?
@CodeWithChris
@CodeWithChris Рік тому
Hi Miguel! Yes it is possible. You may check out this blog post for more info www.hackingwithswift.com/example-code/uikit/how-to-use-uipickerview. You can also post on our CodeCrew forum (codecrew.codewithchris.com) if you have more questions so our tech support staff can assist you further. :) - Pat
@MuhammadAli-zv5vz
@MuhammadAli-zv5vz 5 років тому
i am very lazy person i like storyboards.😛
@aloisohzh
@aloisohzh 3 роки тому
Are there any free software or apps similar to xcode so I can do the storyboard on windows?
@CodeWithChris
@CodeWithChris 3 роки тому
You can use Android Studio on Windows so you can create Android apps. If you want to create iOS apps, you really have to use Xcode. Luckily, there are some ways you can get Xcode on Windows bit.ly/CWCWindows - Kat
@frinkyutbe9725
@frinkyutbe9725 3 роки тому
I'm a beginner comes from Android development, the Apple guides and many videos tell me to use the storyboard. But, as you said, the storyboard is not good at version control, I think the comparision of xml is harder to read than Android's, I will try to use the programmatic UI for the better control.
@CodeWithChris
@CodeWithChris 3 роки тому
Hello, yes changes in UI will be hard to track on storyboard but you can always specify it in the comments of the version control push - Francis
@frinkyutbe9725
@frinkyutbe9725 3 роки тому
@@CodeWithChris Thanks for your reply. Yes, we should always leave a clear comment for each commits. But someone may not keep the well commits, and we can't stop them because of some reasons, so I often have to compare the code without a good comment.
@gjermundification
@gjermundification 5 років тому
3:52 And for the designers and some U/X people Storyboards are way better.
@zenoromio538
@zenoromio538 3 роки тому
Here in 2021. Do you think that storyboard is still a valid option or do you think that SwiftUI is better?
@CodeWithChris
@CodeWithChris 3 роки тому
Yup, storyboard is still a valid option because it's been used by industries for a long time. SwiftUI is more of a newcomer. :-) -Arthur
@sergeyyavorsky3903
@sergeyyavorsky3903 3 роки тому
Could you please give me a name or a link to your keyboard from the video.
@CodeWithChris
@CodeWithChris 3 роки тому
Like the kind of keyboard that Chris uses? -Arthur
@sergeyyavorsky3903
@sergeyyavorsky3903 3 роки тому
@@CodeWithChris Yes
@Wutodouble
@Wutodouble 2 роки тому
How come in CWC 14 day challenge we use swift UI instead of storyboards?
@CodeWithChris
@CodeWithChris 2 роки тому
"Hello, moving forward we will only be making tutorials only in SwiftUI now because it will be more and more relevant as time goes on - Francis"
@Foxygrandpa2131
@Foxygrandpa2131 3 роки тому
Seems like storyboards are the best option for quick and dirty prototyping, especially when launching your first MVP
@CodeWithChris
@CodeWithChris 3 роки тому
Hello, yes it usually gives you are clear and easier overview on what you want to achieve, you can also make a wireframe in figma or some other app as well - Francis
@rupeshkadam9703
@rupeshkadam9703 4 роки тому
xcode 11 is total messed up when opened. plz help
@CodeWithChris
@CodeWithChris 4 роки тому
Hello, what problem are you having? We created a forum for people needing help. Could you share this to our CodeCrew Community codecrew.codewithchris.com/ with details and screenshots if possible? Thanks! -Kat
@woolfel
@woolfel 2 роки тому
The big reason I use storyboard is the business users. I can show business users the code, but they won't understand. Something visual like a storyboard helps non-technical users understand how things flow in the app. Some people will argue, just run the simulator to show the flow. For small apps, that's fine, but if you have more than a dozen screens having a storyboard is much easier to see. It's the reason movie directors storyboard to work through the flow. UX designers prefer storyboard and it's for a good reason.
@CodeWithChris
@CodeWithChris 2 роки тому
Great insights! Thanks for sharing these1 :) -Arthur
@natgenesis5038
@natgenesis5038 2 роки тому
Swift ui and UI programmatically my preference
@CodeWithChris
@CodeWithChris 2 роки тому
Awesome, thanks for watching! -Arthur
@natgenesis5038
@natgenesis5038 2 роки тому
I think we need both UI and Storyboard
@CodeWithChris
@CodeWithChris 2 роки тому
True! Learning both won't hurt! :) -Arthur
@DNAatWork14
@DNAatWork14 5 років тому
When I hit the breaking point I give in, learn the hard way...
@pratikgupta7373
@pratikgupta7373 5 років тому
0:12 it's Bob Lee I have taken his udemy course
@CodeWithChris
@CodeWithChris 5 років тому
How was your experience with his course? @AdrienVillez
@rgenericson5361
@rgenericson5361 4 роки тому
@@CodeWithChris Ya that's Bob Lee from back in the day! He ditched iOS during the Bitcoin boon a few years back. Haven't seen nor heard from him since. I bought his advanced Swift course. At the time it seemed that he was really on top of things, however after two years noodling with Swift and watching the vids on Udemy, he wasn't as polished as he could have been. A lot of spelling mistakes etc. Granted English wasn't his first language. The great part was that he focused solely on Swift not iOS. He could have really made a successful run had he stayed the course and expanded on his Swift courses. They were lacking exercises unfortunately. There is still tons of opportunity to create really good Swift only training content but 99% of instructors still only scratch the surface.
@MrGZM90
@MrGZM90 3 роки тому
but how about combine uikit and swiftui together?!
@CodeWithChris
@CodeWithChris 3 роки тому
Hello, UIKit can still be used by UIKit, the built-in functions will be the same, the main difference is how the data/UI is being built/presented but overall it still uses UIKit for the "logic" behind everything - Francis
@TM-jb8bw
@TM-jb8bw 4 роки тому
So a new iOS deveper (frontend developer atm) i have to learn building apps using storyboards, UIKit with code and Swift UI. Thats crazy just to build a user interface. Right @CodeWithChris ?
@CodeWithChris
@CodeWithChris 4 роки тому
Should be no problem as Swift is just an extension of UIKit just written a bit differently :) - Francis
@the0dd1out_on_yt
@the0dd1out_on_yt 2 роки тому
You saved my ass bruh
@CodeWithChris
@CodeWithChris 2 роки тому
Glad to know. Thank you for appreciating our work! -Arthur
@TonyDaExpert
@TonyDaExpert 3 роки тому
Then swift UI came in
@CodeWithChris
@CodeWithChris 3 роки тому
Still recommend learning storyboards first. 😉 - Kat
@Bazlightyear007
@Bazlightyear007 3 роки тому
It’s slow? Time to get the new Mac with the m1 chip 😁
@CodeWithChris
@CodeWithChris 3 роки тому
Haha, nice rec! :-) -Arthur
@guitaripod
@guitaripod 3 роки тому
Imo those two points for IB aren't really that strong. So TLDR for this video is kind of "Programmatic is better, but I do IB for views" 😂
@CodeWithChris
@CodeWithChris 3 роки тому
Hello, ofcourse everything needs to be programmed (coded) but for the position/location, size, constraints of the UI element it can be easily edited and previewed using the storyboard, then you just use IBOutlet or IBAction to "connect" to it - Francis
@ianosgnatiuc
@ianosgnatiuc 4 роки тому
All your points are "it's faster and easier for beginners". These aren't important. The points you put againsts the storyboards are real in any projects where there are more than one person who works on a project.
@CodeWithChris
@CodeWithChris 4 роки тому
Thanks for your feedback! - Kat
Машины в 2018 и в 2024
00:15
Gazan
Переглядів 1,4 млн
Піхотинець - про рутину на фронті
00:46
Суспільне Новини
Переглядів 293 тис.
Most overpowered way to build mobile apps?
8:33
Beyond Fireship
Переглядів 677 тис.
How I learned iOS Development in 30 Days? 0 to Pro!
13:26
Harnoor Singh
Переглядів 172 тис.
iOS Navigation Controller Tutorial | Xcode 11.4 Swift 5.2
9:56
Sean Allen
Переглядів 114 тис.
Xcode Tutorial for Beginners - (using the new Xcode 11)
41:10
CodeWithChris
Переглядів 498 тис.
I learned to code from scratch in 1 year. Here's how.
41:55
Thomas Frank
Переглядів 300 тис.
Performance between LazyVStack, VStack and List #SwiftUI
8:09
Swift and Tips
Переглядів 9 тис.
iOS Programming - Basics of UIButton (Interface Builder - Storyboard)
18:16
Connect Firebase to Xcode: A Step-by-Step Tutorial | Firebase Bootcamp #1
21:07