UITableView Tutorial w/ Custom Cells - Programmatic - Swift 5 - Xcode 11

  Рет қаралды 72,857

Sean Allen

Sean Allen

Күн бұрын

In this Swift tutorial we're going to build a UITableView with a custom UITableViewCell completely programatically. No Storyboard. I go through building it, and the give a summary at the end for full understanding.
This tutorial was built using Xcode 11 and Swift 5.1.
Starting a project without storyboard:
• Xcode 11 - Create a Ne...
Beginner Auto-Layout Constraints:
• Beginner Auto Layout &...
Beginner Programmatic UI:
• Video
If you like my teaching style, I've released my first iOS dev course which is all about the take-home project job interview for iOS developers.
Course Info - seanallen.teachable.com/
Link to my book - How I Became an iOS Developer:
gumroad.com/l/sean-allen-origin
Hired.com:
hired.com/x/1n01g
Check out my podcast, iOS Dev Discussions:
itunes.apple.com/us/podcast/i...
I stream gaming content on Twitch:
twitch.tv/seanallen
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Ray Wenderlich Books:
store.raywenderlich.com/a/208...
Ray Wenderlich Videos:
store.raywenderlich.com/a/208...
Paul Hudson's Hacking With Swift:
gumroad.com/a/762098803
Learn Advanced Swift Here:
gumroad.com/a/656585843
Links to my iOS Dev Setup & iOS Dev Book Recommendations
www.amazon.com/shop/seanallen
Personal Links:
Twitter:
/ seanallen_dev
Instagram:
@seanallen_dev

Пікірлер: 175
@seanallen
@seanallen 4 жыл бұрын
Watch Next - iOS Take Home Project - Job Interview Practice - Free Preview - kzfaq.info/get/bejne/g7l5mJWqm6zJlWw.html
@oomten10
@oomten10 2 жыл бұрын
I just can't express how I grateful for this tutorial! You are amazing!
@seanallen
@seanallen 2 жыл бұрын
Happy to hear it was helpful!
@natelehoux7604
@natelehoux7604 4 жыл бұрын
Best programmatic table setup tutorial I've found. Awesome job explaining the details!
@seanallen
@seanallen 4 жыл бұрын
Glad it was helpful!
@KevinFi747
@KevinFi747 4 жыл бұрын
Excellent video! You are by far the best Swift instructor I have come across. Your ability to explain exactly what you are doing and why you are doing it is phenomenal and VERY helpful to the viewers! I learnt a lot from this video.
@seanallen
@seanallen 4 жыл бұрын
Thanks Kevin! Glad you enjoyed the video and that you learned from it 😀
@noamif
@noamif 4 жыл бұрын
Man it's insane how every problem that im facing while trying to build something programatically, you've already made a long, specific, teaching video to solve my issues. THANK YOU!
@seanallen
@seanallen 4 жыл бұрын
Happy to help, Noam 😀. If that's the case you'll probably love my courses at seanallen.co. (shameless plug 😂)
@jasonchan6273
@jasonchan6273 4 жыл бұрын
Mannn! One thing I like about your videos is that the explanations are crystal clear, and the codes incredibly neat and tidy. Really satisfying and sexy! Keep up the great work man!
@seanallen
@seanallen 4 жыл бұрын
Thanks for the kind words, Jason!
@gmostafaali
@gmostafaali 3 жыл бұрын
I always love to do programmatically. You are great Sean.
@gakkieNL
@gakkieNL 4 жыл бұрын
Great seeing you do these tutorials again... Nice bedtime leisure to me ;)
@seanallen
@seanallen 4 жыл бұрын
Glad you liked it!
@reemotto
@reemotto 2 жыл бұрын
Thanks for the lessons Sean, it's really helps me! 😉
@zippytoad507
@zippytoad507 3 жыл бұрын
I do like the programmatic style. Thanks mate!
@AdailtonSilvaSP
@AdailtonSilvaSP Жыл бұрын
Sean, Tks for this video!! it was very helpful to me!!!
@justingoody3624
@justingoody3624 4 жыл бұрын
Dude, this is brilliant! now i understand UITableView.
@seanallen
@seanallen 4 жыл бұрын
Happy it was helpful, Justin!
@Jngrowdon
@Jngrowdon 3 жыл бұрын
Sean - great video! Thanks!
@TheTruthSentMe
@TheTruthSentMe 4 жыл бұрын
I didn't even need the wrap-up at the end. It was very easy to follow. I agree that the abstractions help understand the code better, so they're worth it.
@seanallen
@seanallen 4 жыл бұрын
That's great to hear. Glad it was helpful 😀
@Chavalk
@Chavalk Жыл бұрын
Great video! Thanks a lot Sean!
@seanallen
@seanallen Жыл бұрын
Glad you enjoyed it, Jose!
@leticiaf.3808
@leticiaf.3808 3 жыл бұрын
Thanks Sean! 🧡
@jerrick.warren
@jerrick.warren 4 жыл бұрын
Perfect timing. Thanks!!
@seanallen
@seanallen 4 жыл бұрын
Happy to help, Jerrick!
@nimalead66
@nimalead66 Жыл бұрын
What a great Video!!!
@amuse_me
@amuse_me 2 жыл бұрын
Perfect. thanks!!!
@dawei84_dev
@dawei84_dev 11 ай бұрын
Hi Sean, I would say this tutorial has definitely helped me a lot!
@seanallen
@seanallen 11 ай бұрын
Great to hear!
@dinishatennakoon
@dinishatennakoon 4 жыл бұрын
This was really helpful!! Thanks alot!
@seanallen
@seanallen 4 жыл бұрын
Glad you enjoyed it, Dinisha!
@andreysilver5496
@andreysilver5496 4 жыл бұрын
very good stuff. Thank you.
@seanallen
@seanallen 4 жыл бұрын
Glad you liked it!
@ralphGabbbbbb
@ralphGabbbbbb 4 жыл бұрын
From a 6 year experience Android developer, this is a very informative tutorial. Swift is really kinda like a brother to Kotlin. Cheers
@seanallen
@seanallen 4 жыл бұрын
Yes, Kotlin and Swift are pretty similar. Glad you found it helpful!
@dragossusi
@dragossusi 4 жыл бұрын
Yeah, but this extension for protocols looks nice but cannot be done in a jvm environment so kotlin can’t do that, you have to implement the methods in the class or a new interface(that will use inlining)
@zoma128
@zoma128 4 жыл бұрын
couple of day's ago i start thinking to switch from storyboard to code and you start to do a lot of only code tutorial i think that this is a sign for me to switch right now :D Thank you for this great tutorial keep going
@seanallen
@seanallen 4 жыл бұрын
There has been pent up demand for these kinds of tutorials from me for a while now. I'm just finally getting around to them. My overall philosophy on storyboard/code hasn't changed.
@zoma128
@zoma128 4 жыл бұрын
@@seanallen i'm also still not ready to completely switch to code i think it will be great to mix storyboard with code beside that i love storyboard :D any way i liked your style in explain things keep going and if you can make a tutorial about Design pattern it will be much appreciated
@BryantRicart
@BryantRicart 4 жыл бұрын
You are a genius! Great video.
@seanallen
@seanallen 4 жыл бұрын
Happy to help, Bryant 😀
@wenjuanwang4387
@wenjuanwang4387 3 жыл бұрын
Nice video, i am learning to use programmatic way to design view for ios. So this video is quite useful for me, help me understand a lot. Hope it will come more programmatic view design. :D
@StewartLynch
@StewartLynch 4 жыл бұрын
What I would really like to see is a video on the new Diffable datasource including all CRUD actions plus move rows. This would really be helpful moving forward.
@memofigueredo6931
@memofigueredo6931 4 жыл бұрын
Good video sean thank
@seanallen
@seanallen 4 жыл бұрын
Glad you liked it!
@user-tq4fv8ie6q
@user-tq4fv8ie6q 4 жыл бұрын
thanks for great video
@seanallen
@seanallen 4 жыл бұрын
Glad you liked it!
@darthramen8328
@darthramen8328 3 жыл бұрын
This saved my life
@parkeramundsen7052
@parkeramundsen7052 4 жыл бұрын
Great video! Could you do a similar style video about programmatically using UINavigation controller?
@AliAljoubory
@AliAljoubory 4 жыл бұрын
Yo I had no idea about that snippets feature that's so damn cool.
@seanallen
@seanallen 4 жыл бұрын
Now you know 😀
@datdoesthings
@datdoesthings 4 жыл бұрын
Hey Sean, I got a quick question; At the beginning, where you said you setup the file so you delete the file that the app won’t start with storyboard. Am I still able to use storyboards within my app? I have a 5 tabbed bar application, and one of my teammates has been developing in Storyboard before the big switch. Would be a shame to waste the work. In any case, hope you can give insight and Thanks for the video!
@pskabilan
@pskabilan 4 жыл бұрын
Hello Sean, Could you please advise, how to include the image and title for the header section using UITableView without storyboard. I am struck with registering the class
@youarehere1716
@youarehere1716 2 жыл бұрын
Not bad. Couple of questions: Since you're calling the the overridden constructor init(style:reuseIdentifier:), and passing in a style, what should be done with the subview labels the superclass adds, since each of the UITableViewCell.CellStyle cases adds some subviews and don't claim to return a blank cell? Wouldn't you optimally want clear the subviews it creates first? So how do constraints work if you're not grabbing the protototype cell from Storyboard? Setting the constraints of your own cell subviews to contentView is fine, but when does contentView know about the tableView width/height it will be inserted into? When the cell is dequeued? And finally you might want to mention prepareForReuse() method for the UITableViewCell subclass, which is where the cell can clean itself up for the next post-dequeue processing in the tableView delegate.
@szymontamborski7542
@szymontamborski7542 4 жыл бұрын
Is there any video showing how to push diffrent UIViewController depends on which cell is pressed, programatically?
@diakojafari2107
@diakojafari2107 2 жыл бұрын
big like thanks
@heinzschweitzer7123
@heinzschweitzer7123 4 жыл бұрын
Hi, i build my tableView exactly like you and it works fantastic. After that i build a second view controller and passed the Data to make a Detail View Controller. I make that with your video „Pass Data Between View Controller“ and it works amazing. But now i have a problem, i would like to make a third view controller and get the information from my DetailView Controller and not from the Table View. But i stuck here and i actually dont know how i can fix this. Have you some tips for me? Best reguards Heinz
@Eugene.Berezin
@Eugene.Berezin 4 жыл бұрын
“VideoListVC this is what you see” you almost caught some rap there , Sean lol 😂
@seanallen
@seanallen 4 жыл бұрын
Don't sleep on my flow...
@user-yk4jr4gx1s
@user-yk4jr4gx1s 2 жыл бұрын
Hi there! Let me ask a question please, what was the point in deleting original ViewController. We could rename it if you'd like and whatever?
@darrienhuntley9134
@darrienhuntley9134 4 жыл бұрын
how do you change a specific word in a textview to be clickable and open up another view controller?
@jaymartinez311
@jaymartinez311 4 жыл бұрын
I’m taking this exact thing at DevMountain right now and it’s still confusing. I appreciate the video. Since the corona virus I wasn’t able to go to Utah. So it’s online for now and I’m not to happy with it.
@heinzschweitzer7123
@heinzschweitzer7123 4 жыл бұрын
Hi Sean, I love your videos and I learned really a lot. But I have no idea how I can create a following view controller when I tapped one of the "video" button in the table view. I saw this in that video from you (iOS 11 Navigation Bar Update) I really hope you can help me :) Thanks
@mracipayam
@mracipayam 4 жыл бұрын
You are awesome
@seanallen
@seanallen 4 жыл бұрын
Thanks for the kind words!
@ftmtrading2966
@ftmtrading2966 Жыл бұрын
Hi. Thank you for these videos. They are incredibly detailed and easy to follow. You 'cover all of the bases' so to speak. I wonder if I can get your thoughts, however. After following this video and creating a custom cell, it seems as though the tableView only shows the last object in the array. Any thoughts offhand on where I can look?
@zivzalzstein3776
@zivzalzstein3776 2 жыл бұрын
great video, I just have one question. why the helper functions of the custom cell constraints are not called from didLayoutSubViews()?
@YashSharma-qo1sy
@YashSharma-qo1sy Жыл бұрын
Hi Sean Thanks a ton for all the videos! I am stuck in 1 of my projects where I have tableview with customcells and inside the cell i have an image view and i am getting the images from the API and using there but now I want to integrate pinch zoom into it and we want to zoom the whole tableView together not a particular cell at a time. So the problem I am only able to zoom in the center like you showed in this video but not in corners and all. And I have text in the image so i want it to zoom inother places also not just in center. And when i integrate pan gesture for drag then it is not able to scroll through the tableView as it gets confused between grab and scroll and gets stuck at that particular image only, so I can't do that as well. Can you please guide on how to solve this issue? How to zoom in other parts also not just center???
@67Diadem
@67Diadem 3 жыл бұрын
Hii I have 2 questions, how can we add background image on that..? Not in the table view contents. 2nd, how to make round corners on table view and transparent and add some colour with opacity 50%..? Please help me.. Thanks 😊
@walidelzo1
@walidelzo1 4 жыл бұрын
very good video ,
@seanallen
@seanallen 4 жыл бұрын
Thanks Walid!
@kittiesandbeer
@kittiesandbeer 3 жыл бұрын
The beginner auto layout constraints is set to private, do you have an alternate video?
@LetsBuildThatApp
@LetsBuildThatApp 4 жыл бұрын
Good video and I too find programmatic code very verbose. Luckily with SwiftUI, this entire list with cells can be written in about 15 lines. Doing videos in the future will be much easier.
@walidelzo1
@walidelzo1 4 жыл бұрын
we all learn from you . you are awesome programmer
@seanallen
@seanallen 4 жыл бұрын
Thanks Brian. I agree, Swift UI basically makes this tutorial irrelevant. But, as you know, we're a few years away from that. I'm looking forward to that day tho
@TokyoXtreme
@TokyoXtreme 4 жыл бұрын
@@seanallen I always forget what makes the cells not refresh correctly after dequeing, where photos get placed in the wrong cells when scrolling quickly up and down.
@TheSpiralnotizblock
@TheSpiralnotizblock 3 жыл бұрын
Do you have a video in depth of this part 16:45? The short explanation was also very helpful!
@khawarshehzad487
@khawarshehzad487 4 жыл бұрын
Yo great work! just a quick question - how much experience or knowledge should i be having of swift in general before i move to swift UI framework?
@seanallen
@seanallen 4 жыл бұрын
A lot. SwiftUI is fun to learn and play with for now... but it's not seriously going to be used in production for a few years. If you're trying to get an iOS dev job within the next 1-2 years... it's almost a certainty that it'll be in UIKIt.
@NotoriousGarage
@NotoriousGarage 3 жыл бұрын
Wow !
@nokrato
@nokrato 4 жыл бұрын
18:29 Hi Allen I'm a beginner, I would like to know if it's possible to implement an action in video1.I also wanted to tell you that i love your videos they are helping me a lot you are an inspiration for me. Thanks for everything good day
@fattoofittoo7907
@fattoofittoo7907 Жыл бұрын
could someone tell me where i can find model Video.swift code?
@houssemmimoun2079
@houssemmimoun2079 4 жыл бұрын
how to disable multiple screen ipad ios 13.0 ?
@GrandAmericaMotorcycleRides
@GrandAmericaMotorcycleRides 3 жыл бұрын
Hi Sean, fantastic video! I am adding this video list VC layout to an existing app project. I am using storyboards for the time being. I did pickup in the video where you added a tableView to an existing UIViewController. I have never taken that approach though I am a newb. What advantages are there to adding the Table View to a UIView Controller in that way? Also, I created the UIView+Ext file and created the pin function but for some reason Xcode wants my superview to be unwrapped and recognizes it as an optional so I used "bottomAnchor.constraint(equalTo: superview!.bottomAnchor).isActive = true" and forced unwrapped the superview. I realize the hazard with force unwrap but I am not used to working with tableView inside of a UIViewController like this. Any recommendations? I suppose I could just drag a UITableViewController onto storyboard then incorporate the required tableView functions and pickup from that point in the video? I am going through your course on your site and it is amazing as well!
@seanallen
@seanallen 3 жыл бұрын
Hey Mike, the main reason I like to add TableViews to a ViewController rather than using the built in UITableViewController is that I've found it offers more flexibility. It's been a while, but last I tried to use a UITableViewController it was pretty restrictive. That seems to me meant for basic TableViews. So I've built the habit of creating my own TableViews so I always have the flexibility I need.
@30guarino
@30guarino 4 жыл бұрын
Hey Sean just looking at your video with is great!....Just a quick suggestion...screen shot the app UI or run the app on another simulator, so we can see what's being implemented and you can use the mouse instead of your fingers to explain it...... Happy Holidays and Good Luck on your future course premiere!
@seanallen
@seanallen 4 жыл бұрын
This is a good idea, David. I'll implement this in future videos. Thanks for the suggestion 😀
@nileshjdarji
@nileshjdarji 4 жыл бұрын
In my project I also created a struct of Images and then tried to set msImage type as Images in the struct below struct MS { let msImage: Images let msTitle: String let msDescription: String } after that when I tried to create an array of MS calling images from the Images struct it is giving me an error message as under: 'UIImage' is not convertible to 'Images'. I am unable to fix this. Any idea what's going on ?????
@sanglin9387
@sanglin9387 4 жыл бұрын
space sensitive.. lol
@pgc6240
@pgc6240 3 жыл бұрын
Why do you use Video class and not the struct?
@mohammadakbari5506
@mohammadakbari5506 4 жыл бұрын
Please talk about RXswift and combine Tnx for this video...
@natehedgeman
@natehedgeman 3 жыл бұрын
I've been having trouble with custom cells not performing segues... I've actually been doing a lot of research and I haven't found a single KZfaqr, create a custom cell, and then perform a segue on it. I don't know if that is just a coincidence or what. But if you can perform segues on those cells can you explain how you are doing it?
@evankohi5076
@evankohi5076 4 жыл бұрын
Hi Sean ! if I setup a UI button trigger something inside custom cell class, and use a dequeuereuseable cell inside cellForRowAt indexPath, how to prevent multiple triggers when cell being reuse?
@larrymcdowell2265
@larrymcdowell2265 4 жыл бұрын
One idea I've used: Add a tag to the button, and check it using a Case switch in your click handler to know which button instance was clicked.
@seanallen
@seanallen 4 жыл бұрын
Tags are one way. In my opinion, using a delegate is the cleaner way. I did a video on that - kzfaq.info/get/bejne/i7aidbuGvLbKZoU.html
@evankohi5076
@evankohi5076 4 жыл бұрын
@@larrymcdowell2265 Thanks Larry, I'll try!
@whatsapptext-8766
@whatsapptext-8766 4 жыл бұрын
Is there a download for this project
@await-rescue
@await-rescue 4 жыл бұрын
Great video! Would an enum be better for storing cell identifiers?
@seanallen
@seanallen 4 жыл бұрын
It can go either way. The downside of a struct is that technically you could initialize an empty "Cells" struct. You'll see people do it both ways, but an enum would be slightly better because you can't initialize an empty one. It's trivial.
@gustavaberg6951
@gustavaberg6951 4 жыл бұрын
Hi Sean Great video! i have no errors when i do the code. But when i run it in the simulator it only gets black? The "no storyboard lecture" you did works great, but when i do this tutorial i dosen´t work for me, any idea what i am doing wrong? Thanks in advance!
@seanallen
@seanallen 4 жыл бұрын
Yes, in Xcode 11 and iOS 13, they introduced a new way to remove the storyboard programatically. That's why I made that "No Storyboard" video. You're not doing anything wrong. Xcode just updated the way it does things in Xcode 11 and iOS 13.
@RitaDeCassia-om5fq
@RitaDeCassia-om5fq 4 жыл бұрын
Hello, I am having a problem. My app crashes as soon as I initialize the properties on SceneDelegate and I don't know what I am doing wrong. I've already deleted all the references to the main.storyboard but it seems like it's still looking for it.
@RitaDeCassia-om5fq
@RitaDeCassia-om5fq 4 жыл бұрын
I saw another of your videos and I found my answer haha Thank you so much!!!
@laurynaskapacinskas8008
@laurynaskapacinskas8008 4 жыл бұрын
Hey, is it possible to add spacing between UITableView rows?
@mrmillmill
@mrmillmill 3 жыл бұрын
Hi Laurynas, did you find an answer to this?
@nn7980
@nn7980 4 жыл бұрын
Great explanation, great tutorial as always.. . Sean, can you please suggest some more reference or some textbooks for mastering programmatic approach rather than storyboards.. I have been searching for it for a long time and so far, I could not find one, all of them use storyboard approach.. . I mean, how I can learn the programmatic approach like you did..? there should be some, right..? ) thanks in advance, even if you might not reply back.. .
@seanallen
@seanallen 4 жыл бұрын
I just practiced it little by little. Started with doing one view, then one screen, then entire projects. It takes practice. I'm creating a course at the moment that will do things 100% programatically. There's a KZfaq channel called "Let's Build That App". He does all his tutorials programmatically, which may help.
@mdtarifkhan1825
@mdtarifkhan1825 2 жыл бұрын
how to trim and crop video ? sir, please create a tutorial.
@abdulrapidz
@abdulrapidz 4 жыл бұрын
Any reason why you chose to do configuration via functions rather than lazy vars with closures?
@seanallen
@seanallen 4 жыл бұрын
Personal preference. Both are fine. I like the way the code is laid out and find it easier to reason about that way. But it’s purely subjective.
@dallasgreen85
@dallasgreen85 4 жыл бұрын
Hey Sean, great video as always! Just one small thing: Shouldn‘t you add the image view and title label to the cell‘s content view instead of the cell itself?
@seanallen
@seanallen 4 жыл бұрын
Good question. I'm not sure off the top of my head. I'd have to look into that.
@w0mblemania
@w0mblemania 4 жыл бұрын
@@seanallen Andre is correct.
@ArnsEnglander
@ArnsEnglander 4 жыл бұрын
@@w0mblemania why is that?
@w0mblemania
@w0mblemania 4 жыл бұрын
@@ArnsEnglander It's a design feature (or quirk) of UITableViewCell. Because the cell is responsible for the showing of various accessories, the contentsView is a container to put our custom elements in. Its dimensions (and thus layout) will change when accessories (e.g. checkmark) are shown/hidden.
@swiftynuke9032
@swiftynuke9032 4 жыл бұрын
I love you man you always help us And I today is my birthday
@seanallen
@seanallen 4 жыл бұрын
Happy to help. Happy Birthday!
@kamkoamoh
@kamkoamoh 4 жыл бұрын
Heyy, thank you , good stuff, I hope to see more videos without usage of StoryBoard, I really hope you will make more! Question: Can you explain how to use segue , in code without storyboard, and how to send data from indexPath.row to another ViewController object. Example: If I have an Custom Button in my cell which will push new ViewController, and I want the content of the cell to be send to some objects in my new ViewController. Thank you!
@seanallen
@seanallen 4 жыл бұрын
Segues don't exist without storyboard. But I'll do a continuation of this showing how to pass data programmatically.
@natehedgeman
@natehedgeman 3 жыл бұрын
Custom Cell Aren't Seguing? HERES THE SOLUTION!!! On the storyboard: Create a segue from the cell to the next ViewController. Don't forget to name the segue in Attributes inspector and "NAME THIS WHATEVER YOU WANT". In the TableViewController add this by the other override functions: override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { self.performSegue(withIdentifier: "NAME THIS WHATEVER YOU WANT", sender: self) } I don't know if this is a bug that's never been fixed or if it's some kind of "feature". But it drove me NUTS and it's not talked about enough.
@NicolaasMigliore
@NicolaasMigliore 3 жыл бұрын
Does this also work with storyboard?
@fattoofittoo7907
@fattoofittoo7907 Жыл бұрын
yes
@BranGaming20
@BranGaming20 4 жыл бұрын
its not work for me, i dont know maybe because wihtout scene delegate or because im using storyboard
@seanallen
@seanallen 4 жыл бұрын
Try this one. It's essentially the same up but using Storyboard. kzfaq.info/get/bejne/fNp_aLSFl6rDeGw.html
@jmstajim
@jmstajim 4 жыл бұрын
Hi Sean. Thanks to your lessons, I got my first developer job. But team development turned out to be much more complicated than I expected. We use Coordinators and VIPER, all that without storyboards. Could you tell us more about this and about commercial development. Thank you!
@seanallen
@seanallen 4 жыл бұрын
Every team is going to be different. I have no experience with coordinators and VIPER.
@user-bb8gv9zt1b
@user-bb8gv9zt1b 11 ай бұрын
why is the separator line gone slightly right side..?
@codewithalx
@codewithalx 10 ай бұрын
This is the default separator on iOS, you can do a custom one anytime.
@tny7390
@tny7390 3 жыл бұрын
are these patreon videos still happening?
@nileshjdarji
@nileshjdarji 4 жыл бұрын
What is the difference between: 1) using tableView.rowHeight in line 24 and 2) using tableView method: func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat
@7mach
@7mach Жыл бұрын
nothing difference
@kevinpiip3427
@kevinpiip3427 4 жыл бұрын
im mad cos i have been learning swift and xcode for like 3 months and it has changed so much now that i feel like i have to learn everything again
@seanallen
@seanallen 4 жыл бұрын
I mean this is the absolute nicest way possible... Get used to it. Swift is a VERY young language so change is to be expected. Also, the profession of a software developer has to be able to deal with change as technology is constantly evolving.
@chrispy104k
@chrispy104k 4 жыл бұрын
Kevin, I think it would be fair to say that there hasn't been many changes in the last 3 months. Subtle changes maybe but nothing major. If you are referring to the introduction of SwiftUI as a change, the reality is that SwiftUI is an addition to the available frameworks rather than a change. UIKit is here to stay for a long long time as both Sean and Paul Hudson have said on many occasions.
@danielwatson6529
@danielwatson6529 4 жыл бұрын
Im a bit like that, but i suppose the other comments are right we just need to learn. But it does seem to have come at a rotten point in my learning. But lets persevere bro
@lampreynetworks
@lampreynetworks 4 жыл бұрын
Source code anywhere?
@mmatyjaszczyk21
@mmatyjaszczyk21 4 жыл бұрын
What's the reason you prefer extend your UIViewController class and then create delegates ? Why not subclass UITableViewController directly in your class - that way you got all those functions and tableView etc "for free" without need to type or instantiate anything
@seanallen
@seanallen 4 жыл бұрын
For this basic TableView, that would work. However, I've found UITableViewController to be very limiting, which is why I always create my own.
@muhammadisfanfajar7125
@muhammadisfanfajar7125 4 жыл бұрын
Please create playlist about this programmatically
@seanallen
@seanallen 4 жыл бұрын
Good idea...
@vladimirkuzomenskyi9660
@vladimirkuzomenskyi9660 4 жыл бұрын
Sean, are you always do align the code manually like this 12:15 and 13:47? If yes, there is a way to do it automatically., just by pressing one hotkey to align a bunch of lines simultaneously. Just go *Xcode -> Xcode Extensions* and install the *AlignmentForXcode* extension. That's much easier to do it with single hotkey press. I was completely sure, that you already know it, when I did saw your file at 0:42, but I did lost that sureness later, when I did saw as you do it manually on 12:15 and 13:47. And, maybe if you didn't know about the extension, dive into this and tell us about what are the Xcode extensions you found useful
@seanallen
@seanallen 4 жыл бұрын
I do it manually. I wasn't aware of that extension. I'll give it a look 😀
@Tenly2009
@Tenly2009 4 жыл бұрын
Is this “AlignmentForXcode” different than highlighting the text you want to format and pressing ctrl + i ?
@robtea3941
@robtea3941 Жыл бұрын
Custom subviews should be added to the contentView, otherwise addTarget wont work
@eddwinpaz
@eddwinpaz 4 жыл бұрын
Sean can you teach us how to use viewmodel on tableviews. And Learn the term Skinny views fat models.
@monsterbluegill
@monsterbluegill 4 жыл бұрын
here is an awesome article I found that that walks you through how to do this! I walked thru the tutorial and added some actual api calls to test it out! the article -> medium.com/capital-one-tech/smooth-scrolling-in-uitableview-and-uicollectionview-a012045d77f my implementation -> github.com/ncooke3/MVVMAsyncTableView
@azhmanadam7311
@azhmanadam7311 4 жыл бұрын
when I want to add UIElements Programmatically I Usually do it like this: let view: UIView = { let view = UIView() //Configurations // return view }() I feel this way everything is more way cleaner.
@seanallen
@seanallen 4 жыл бұрын
That's a perfectly fine way to do that. I'm not a fan of that method because I find that the top of my file is all cluttered up with configurations. Just a personal preference.
@tenminutetokyo2643
@tenminutetokyo2643 4 жыл бұрын
DOOD!
@Tenly2009
@Tenly2009 4 жыл бұрын
Hey Sean (or anybody reading this comment). I have been struggling with sizing/resizing of my custom controls and I have googled everything I can think of to try and find a good solution - but I have yet to come across a straightforward answer - so as a last resort, I’ve come here looking for help. I created a custom control that consists of a background label, an image and a few more label overlays. If I initialize it with a specific frame size, it looks great - but if the frame changes after initialization it doesn’t update itself and I have not found a way for the control to be alerted when it’s frame changes so that it can resize all of its sub views appropriately. I am certain there must be a straightforward way to do this - but I haven’t been able to find it - and to work around it, I have been including a function in all of my custom reviews that completely rebuilds all of its constraints and I’ve been calling it much more frequently than I need to in order to make sure that my view is displayed correctly - for example, when my control appears in a collection view - I rebuild all of constraints in the cellforitemat function every time I refresh the collection. I know that’s overkill and kind of defeats the purpose of cell reuse - but I don’t know what the alternative is. If someone can point me to a solution for this, I would be extremely grateful. Thanks in advance. @Sean: Sorry to hijack your comments with this question - but even if you’re annoyed with me for it - I doubt you’ll be as mean about it as the folks over at stackoverflow are. (It genuinely seems like they have more members devoted to telling people their questions are stupid than they have members actually willing to provide answers or helpful guidance!)
@dragossusi
@dragossusi 4 жыл бұрын
Did you write the isActivated = true? And disabled auto resize?
@Tenly2009
@Tenly2009 4 жыл бұрын
Dragos Rachieru No. I’ve never even heard of that setting. Not using storyboard. I think I just need to know the normal way that a UIView is notified that it’s frame has changed - then I can intercept that notification and make sure that all of its subviews are also resized appropriately.
@siva-subramaniam-v
@siva-subramaniam-v Жыл бұрын
BM - 18:00
@user-mx6wc4cy1s
@user-mx6wc4cy1s 2 сағат бұрын
i need its source code
@sanglin9387
@sanglin9387 4 жыл бұрын
a few need to add thing for old version support and some sceneview issue " @available(iOS 11.0,*) @available(iOS 12.0,*) func ios12Support(){ self.window = UIWindow(frame: UIScreen.main.bounds) self.window!.backgroundColor = UIColor.white self.window!.makeKeyAndVisible() self.navigationController = UINavigationController(rootViewController: ViewController()) self.window!.rootViewController = self.navigationController } "
@jamilamini7807
@jamilamini7807 4 жыл бұрын
source code please
@dannylones2159
@dannylones2159 4 жыл бұрын
👏 for func pin
@seanallen
@seanallen 4 жыл бұрын
Glad you liked that 😀
@stormwaker
@stormwaker 3 жыл бұрын
8:50 that's why most people just use SnapKit
@rasheshbosamiya1482
@rasheshbosamiya1482 4 жыл бұрын
You probably can use UITableViewController instead of UIViewController.
@seanallen
@seanallen 4 жыл бұрын
I find that to be very restrictive.
@rasheshbosamiya1482
@rasheshbosamiya1482 4 жыл бұрын
Sean Allen restrictive, in terms of future change adaptations?
@seanallen
@seanallen 4 жыл бұрын
Restrictive like if it's a SUPER basic TableView, then sure. But anything more than a SUPER basic TableView, I don't want to use UITableViewController.
@w0mblemania
@w0mblemania 4 жыл бұрын
Rashesh, a UTableViewController is tied to the concept of being a fullscreen view. Sometimes, you need a UITableView that only occupies part of a screen. (e.g. you have a banner or some chrome above the tableView). In those cases, you _could_ fudge things so that the UITableView has special sections and rows just for that UI, but it's not a good solution. It's better and easier to create a UITableView manually, and position it exactly where you need it in your view hiearachy.
@user-yw1mm5qi7d
@user-yw1mm5qi7d 4 жыл бұрын
谢谢你的教程 - 来自中国开发者的问候
@seanallen
@seanallen 4 жыл бұрын
Glad it helped!
Intro to Programmatic UI - UIKit | Xcode 14
17:39
Sean Allen
Рет қаралды 48 М.
SwiftUI List with Custom Cell & Passing Data
36:27
Sean Allen
Рет қаралды 115 М.
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 25 МЛН
Swift: TableView w/ Custom Cells Tutorial (2021, iOS) - 2021
16:09
How to use Lazy in Swift
9:56
Sean Allen
Рет қаралды 39 М.
Swift Access Control Explained
9:44
Sean Allen
Рет қаралды 33 М.
UISegmentedControl - Storyboard & Programmatic - Swift
13:52
Sean Allen
Рет қаралды 20 М.
TableView With Custom Cells In Swift - Tutorial
16:40
iOS Academy
Рет қаралды 53 М.
UIViewController - Lifecycle | Swift | viewDidLoad
7:57
Sean Allen
Рет қаралды 40 М.
Хакер взломал компьютер с USB кабеля. Кевин Митник.
0:58
Последний Оплот Безопасности
Рет қаралды 2,3 МЛН
Мой новый мега монитор!🤯
1:00
Корнеич
Рет қаралды 600 М.
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 549 М.