HomeНаука и техникаRelated VideosMore From: Kilo Loco

UITableView: Add & Delete Cells | Swift 4, Xcode 9

109 ratings | 6805 views
Today we go over how to add and delete rows to a UITableView with Swift 4. In this tutorial, you will learn how to insert and delete a cell at a specified index path as well as how to change the animation of these actions. In almost every app, you will be expected to work with UITableViews. Being able to add and delete individual cells is something that you will come across eventually and being able to handle these actions in a sexy way will definitely pay off. See what's next on the schedule by checking out my Trello board: https://trello.com/b/TNhRZsB2/kilo-loco-content-flow The finished project is available to any students of the free YouTube On my website. Make sure you enroll today: https://www.kiloloco.com/p/youtube If you have any questions or comments about the tutorial, or want to suggest a video to make, feel free to leave a comment below, or reach out to me on Twitter: https://twitter.com/kilo_loco If you found this tutorial helpful, make sure to subscribe to the channel for more great tutorials.
Html code for embedding videos on your blog
Text Comments (24)
Flippy Dip (7 months ago)
This tutorial easily explains how to set up and perform basic functions in a table view very well, but I seem to be encountering an error. When I Create a new item, it prints the text I entered with no errors, but a cell with the text I entered does not appear. However, if I insert a breakpoint right before I append the item, when I continue from the breakpoint I get this error: [7112:1013034] [Common] _BSMachError: port 821b; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND". I was wondering if anyone else has ran into this/knows a fix for it.
Abdiel Studio (10 months ago)
Hi Kilo Loco, great video im learning a lot! Can you also create a video for table view that can display the user submit only. Thank you so much!
Dev Shishir (1 year ago)
Very nice
Sam Ruben (1 year ago)
When I run the app, it gives me a problem that says "attempt to insert row 0 into section 0, but there are only 0 rows in section 0 after the update" I have your code line for line, is there anyway u can help?
Lucas (9 months ago)
I'm getting the same error
Hardwood Hits (1 year ago)
Say I have a persistence layer setup, is there a way for the delete function to permanently delete?
Amulya H. N (1 year ago)
How to delete when clicked on delete button
Kilo Loco (1 year ago)
It’s the same as delete with the swipe. Both will work
Sarav Soundar (1 year ago)
Hi Bro, your tutorials are awesome!! Thanks a lot for sharing your knowledge. I was following your tutorial and I got a problem. If I do no enter a dessert and hint add. It will add an empty cell on the table. How do I avoid that?
Kilo Loco (1 year ago)
No problem 😁
Sarav Soundar (1 year ago)
Thanks Bro!!!
Kilo Loco (1 year ago)
You can put a guard statement that checks to make sure that the string is empty. That’s usually how I handle it...
Nikolai Rivas (1 year ago)
I watch a lot of different tutorials about swift, but yours are my favorite. Not only do I get the information that I'm looking for, but it's fun. you're hilarious man. Thanks for the vids
Kilo Loco (1 year ago)
That’s exactly what I’m after 😁👍🏽
Tam Ibz (1 year ago)
how do I make it so when I go on the app and make a dessert then I close the app and go back on it, It will display what dessert I typed in
Kilo Loco (1 year ago)
That would require some type of persistence layer to be incorporated into your app. Once you close an app, everything in memory is gone. If you already have persistence in your app, then you would have to either pass the data using Delegates, notifications, or some other method.
GameGenius (1 year ago)
it won't let me go on your website for some reason
Kilo Loco (1 year ago)
Sorry, I was working on some stuff for the new platform and it caused the current site some problems. Everything should be working fine now though 👍🏽
Ravikumar e (1 year ago)
Hey bro your way of explanation is excellent.Sexy information bro.
Kilo Loco (1 year ago)
Keeping the information sexy is almost as important as coding passionately 😉
Kris Valas (1 year ago)
What is the benefit to using guard let instead of if let?
Kilo Loco (1 year ago)
It looks so much sexier than a pyramid of doom 😉 overall they both work the same essentially
Kevin Proctor (1 year ago)
I'd love to see a tutorial that shows how to edit and save information saved to core data. I really like all your tutorials.
Kilo Loco (1 year ago)
+Kevin Proctor this video might be helpful https://youtu.be/tP4OGvIRUC4

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.