If different cells in stead of 3 cells in each section.. like 1st section 9 cells ,2 nd section 3 cells like this.. please do this.. when I click cells it will be go to next view controller
Hi Jared, could you do a video on create two or multiple tableviews using a single view controller? And would it be right to keep the multiple UITableViewCells in a separate file rather then putting them in the view controller, when creating a multiple tableviews? Thanks
Thanks for the tutorial! It's very helpful, although I have an issue with the collapsing of the cells, it looks okay as long as the expanded cells are small, however when they increase in height the animation begins to break
Great tutorial. The only thing I didn't grasp is what is actually telling the section to open or close. I don't see that we actually manipulated a property, just that we changed the struct's true/false property, which in itself shouldn't do anything as we created it. The reload sections seems pretty straight forward, I just don't see what part of the code tells the cell to open or close.
If you would like to indent the cells that contain the section data, place "cell.layoutMargins.left = 30" under the cellForRowAt function. Please note, place this code under the else clause of "if indexPath.row == 0" part of the function. Hope this helps someone!
When changing the viewcontroller name, you can press command and click the viewcontroller and that will change the name and the .swift file name at the same time. Helpful hint I found
Can you make a video about how to use Date objects? The video you made a couple years ago uses code that doesn't work anymore. Can you show us how to make an alarm? I feel like that'd be a good demonstration of how to use Date objects. Would really appreciate it!
Hello What I am doing is select date + insert data into text field then press submit to be pushed into TableViewController to display in TableViewCell in Labels, the issue is I cannot figure out how to do that, so every time you pick the date and the data and press submit it must sort in the tableviewcontroller in new tableviewcell.
Can I do similar operation on a UIViewController by creating table view cell or it has to be a TableViewController only? I am new to Swift and my usecase has other UIViewController embedded in SegmentedViewController which is also a UIViewController
hey Jerad.. loved your videos... very simple and easy to understand.. could you make a video where there are 2 drop down menus where if I select Dog in 1st drop down menu then a list of all the dog breeds shows in the 2nd drop down menu automatically.. and if I select cat in 1st drop down menu then a list of all the cat breed shows in 2nd drop down menu automatically... hope you get what i meant to say.. thanx in advance...
Having trouble applying the struct to a multi array of dates. All data is created at runtime so I can’t add it like you did to the array of strings like the example. Any help would be appreciated.
Thanks a lot for the video man! I have been searching for a way to collapse previously expanded cell once the user taps to expand another cell but couldn't figure out. Do you know how we can add this feature? Thanks in advance :)
One more try. If I have a global variable "term" and I am using it to pass the term over to the details view, what would the line of code look like? I have tried indexPath.row but get no value for the term from the "cell" value. I know where the line of code goes, but nothing that I have tried will pass the term to the details view controller.
Please correct the Video, it Should return sectionData.count + 1 in numberOfRows Function, because your Cell1 is not visible on tapping the header. only cell2 & cell3 are visible. Adding +1 at numberofRows would solve this problem
Jared have you tried to select the header row twice ? if i select row at first it works fine and when i close the row and then select it again it goes out of order like (cell1,cell2,cell3) becomes (cell3,cell1,cell2,cell3 ) and each time i click it it keeps on expanding . Any one faced this problem , if then help me out i'm using my custom cell in header section
Hope you guys enjoy this video! What other topics would you like to see? Would love to show some of the background of what goes on in my daily life working on Tag, if you guys are interested. Might reserve that for a second channel thing though... we'll see. :] Video is taking a while to process to 4K, but it should be coming soon! :]
Great video, 🔥Please make a stripe paid membership period subscription that will allow user to access specific data, I really need help with that ASAP and there is no tutorial about it 👏🏽 stripe + firebase
Hello, great video. thanks for the help. One question, is there a particular reason why you delete the initial viewcontroller and add a tableviewcontroller? instead of adding a tableview to the viewcontroller? thanks
Not him, but it's basically to not have to write boilerplate code for the purpose of this video. To add a tableView you'd have to either drag it on screen in the storyboard to your viewcontroller and then connect it as an IBOutlet to your file, or manually instantiate it and then add it is a subview to your viewControllers view property. You'd also have to set up it's constraints (programatically or Interface Builder), set the delegate and dataSource of the tableView to your VC, and implement required methods of the dataSource. Or you could roll your own dataSource as a NSObject sucblass that conforms to UITableViewDataSource/UITableViewDelegate. A subclass of UITableViewController on the other hand already sets up most of this for free, you just have to override UITableViewControllers methods which correspond to the same methods from UITableViewDataSource and UITableViewDelegate protocols.
Jared, I using animation and I’ve more elements (example 50 sections). I open section (example 0 section) and scrolled my table to middle and I opened section 20, that my table jump :(
hi, excellent tutorial.. can you help if we have more subsection inside SectionData? for example [CellData(opened: false, title: "Title 1", Sectiondata: [["Cell1", "Cell2"],["Cell1"],["Cell1", "Cell2", "Cell3"]
Honestly, those jord watches do look really nice. I just heard about them in this video. I am really picky on watches but these seem to fit my style. Expensive, but great looking!
R3MIX MODZ I get approached by a surprising amount of advertisers, and I try and only pick the best. Saw their website and watches they made and was thrilled to be sponsored by them, haha. Glad you found them cool too! :D
Wow, what a coincidence! I saw a man wearing jord watch two days ago, and I liked the wood theme. I didn't know what the brand was, but thank you! You answered my question here :)
How would you pass the value for a list item within a heading item. I tried passing the textLabel.text value to the details view and keep getting no value for that.
Instead of the button in the cell use an image or view that is customised to your likings then use the tableView function of didSelectRowAt: indexPath . As for the height, you may not need to worry about it, just use tableView.rowHeight = UITableView.automaticDimension and it should scale up to match the content inside the cell
how to show different array of items for each child cell for eg. sectionData["cell2","cell2","cell3"] sectionData["cell2","cell2","cell3"] sectionData["cell2","cell2","cell3"] -- in your program but, i want to show the data like this eg. sectionData1[cell1: "c", cell1:"b", cell3: "c"] sectionData3[cell11: "c", cell12:"b", cell13: "c"] sectionData2[cell21: "c", cell22:"b", cell23: "c"]
how can I retrieve my core data entity's item in the expandable cells instead of static data which is used by you, example cell1,cell2,cell3, thank you in advance
im sorry that i'm asking over and over :) can i use 2 diffrent cells for sub cell and main cell ? i will use the sub cells to show details of some cell data
Been a watch guy my whole life, but have never really found one I loved & carried around. Usually I just got too sweaty, haha. Was awesome to have them reach out! Wood-watch bands are what I was missing in my life. Plus, it'll be nice to have on my mission! :D Good luck!
jared thank you so much! a beautiful tutorial! I have just a question: I implemented your code in a way that you can have just one section open at the time. so when you click to expand a section and there was another that you have expanded before, the app close the previous section opened and it opens the other. here the problem: if I open and close the same section it works perfectly, but if I open another section it crashes with this message: "libc++abi.dylib: terminating with uncaught exception of type NSException". here you can watch a video with it: www.dropbox.com/s/99j9d2zjqr4vrcu/video%20of%20error.MOV?dl=0 and here you can find all the project to try it: www.dropbox.com/sh/i00nlwfp1r3b8a2/AADJvqdGocL-lZJ1-PFBIBB6a?dl=0 please I need help. I don't know if you can add it to the video, or just tell me where I'm making the error. thank you again for your great job. you can find the post on stack overflow here with more information: stackoverflow.com/questions/51895695/libcabi-dylib-terminating-with-uncaught-exception-of-type-nsexception-trying
Great video, 🔥Please make a stripe paid membership period subscription that will allow user to access specific data, I really need help with that ASAP and there is no tutorial about it 👏🏽 stripe + firebase
Hai ,My Json dict is as follows After decoding of Json, How to get this details in a single tableview ,any one help me How can i create json module also thanks! [{"StudentID":2451,"ClassID":49,"SectionID":404,"Total":75.0,"Percentage":62.5,"Result":"PASS","RankGrade":"D","subjectmarks":[{"SubjectID":158,"SubjectCode":"TAM","SubjectName":"TAMIL","Mark":4.5},{"SubjectID":159,"SubjectCode":"ENG","SubjectName":"ENGLISH","Mark":8.5},{"SubjectID":160,"SubjectCode":"HIN","SubjectName":"HINDI","Mark":15.0},{"SubjectID":161,"SubjectCode":"MAT","SubjectName":"MATHS","Mark":12.5},{"SubjectID":165,"SubjectCode":"SCE","SubjectName":"SCEINCE","Mark":17.0},{"SubjectID":166,"SubjectCode":"SOC","SubjectName":"SOCIAL SCIENCE","Mark":17.5}],... }]
This is the best expandable tableview cells video I have come acrossed on internet.
If different cells in stead of 3 cells in each section.. like 1st section 9 cells ,2 nd section 3 cells like this.. please do this.. when I click cells it will be go to next view controller
did u find any solution for this
@@kuldeepbhandari7276 no
@@BalaaLyf oh so u didn't find any solution yet
Hi Jared, could you do a video on create two or multiple tableviews using a single view controller? And would it be right to keep the multiple UITableViewCells in a separate file rather then putting them in the view controller, when creating a multiple tableviews? Thanks
Thanks for the tutorial! It's very helpful, although I have an issue with the collapsing of the cells, it looks okay as long as the expanded cells are small, however when they increase in height the animation begins to break
Great tutorial. The only thing I didn't grasp is what is actually telling the section to open or close. I don't see that we actually manipulated a property, just that we changed the struct's true/false property, which in itself shouldn't do anything as we created it. The reload sections seems pretty straight forward, I just don't see what part of the code tells the cell to open or close.
Can you make a tutorial about selecting multiple items in collection view and deleting them?
If you would like to indent the cells that contain the section data, place "cell.layoutMargins.left = 30" under the cellForRowAt function. Please note, place this code under the else clause of "if indexPath.row == 0" part of the function. Hope this helps someone!
Yes, it help me. Do you know how we can perfirm action on the click of Cell1 or cell 2 under particular section?
You can also do this in the Interface Builder for a seperate prototype cell
Awesome explanation of this concept!
Nice, I like the shot of the Salt Lake Temple. I used to see that everyday when I lived in Salt Lake working at FamilySearch.
Also, I didn't know that reloadSections method existed. That is super helpful. Thank you!
When changing the viewcontroller name, you can press command and click the viewcontroller and that will change the name and the .swift file name at the same time. Helpful hint I found
It’s so helpful for me, you’re my lifesaver😸
Hey Jared. Thank you so much i completed iOS subject in MCA Degree. Your videos really helped me everytime i got stuck......
Best tutorial for expandable cells.. Thanks😇
Can you make a video about how to use Date objects? The video you made a couple years ago uses code that doesn't work anymore. Can you show us how to make an alarm? I feel like that'd be a good demonstration of how to use Date objects. Would really appreciate it!
exactly what I was trying to do with my tableview. Thanks Jared!
Awesome! Glad I could help! :D
Hello What I am doing is select date + insert data into text field then press submit to be pushed into TableViewController to display in TableViewCell in Labels, the issue is I cannot figure out how to do that, so every time you pick the date and the data and press submit it must sort in the tableviewcontroller in new tableviewcell.
Can I do similar operation on a UIViewController by creating table view cell or it has to be a TableViewController only? I am new to Swift and my usecase has other UIViewController embedded in SegmentedViewController which is also a UIViewController
he knows the need of speed! All tutorials should be same fast!
hey Jerad.. loved your videos... very simple and easy to understand.. could you make a video where there are 2 drop down menus where if I select Dog in 1st drop down menu then a list of all the dog breeds shows in the 2nd drop down menu automatically.. and if I select cat in 1st drop down menu then a list of all the cat breed shows in 2nd drop down menu automatically... hope you get what i meant to say.. thanx in advance...
Having trouble applying the struct to a multi array of dates. All data is created at runtime so I can’t add it like you did to the array of strings like the example. Any help would be appreciated.
Thanks a lot for the video man! I have been searching for a way to collapse previously expanded cell once the user taps to expand another cell but couldn't figure out. Do you know how we can add this feature? Thanks in advance :)
Thats how found a solution for it; first I declared a variable as; "var currentIndexPath: IndexPath?"
Then I've coded this at didSelecRowAt method;
var sections:IndexSet = []
if let currentIndexPath = currentIndexPath {
if (currentIndexPath.section == indexPath.section) {
userArray[indexPath.section].opened = false
sections = [indexPath.section]
self.currentIndexPath = nil;
} else {
userArray[indexPath.section].opened = true
userArray[currentIndexPath.section].opened = false;
sections = [indexPath.section, currentIndexPath.section]
self.currentIndexPath = indexPath
}
} else {
currentIndexPath = indexPath;
userArray[indexPath.section].opened = true;
sections = [indexPath.section]
}
tableView.reloadSections(sections, with: .automatic)
it works for me , thanks , where should i write code of perform segue in specific cell ?
Hi master a question, how can I change the background color of the cell when it happens to be a section?
Great tutorial And happy coding . Thanks a lot
One more try. If I have a global variable "term" and I am using it to pass the term over to the details view, what would the line of code look like? I have tried indexPath.row but get no value for the term from the "cell" value. I know where the line of code goes, but nothing that I have tried will pass the term to the details view controller.
Hi thanks for the video! I'd like to know how can I add indentation to the cells? Thank you!
Hi, the cells (1, 2 and 3) is it possible to turn them into UITextFields? thanks
hi Jared!! i have one more expand inside tableview. what should i do? .. please help me
Make video on nested json parsing in decodable in swift 4.1
Thanks, Jared!
Please correct the Video, it Should return sectionData.count + 1 in numberOfRows Function, because your Cell1 is not visible on tapping the header. only cell2 & cell3 are visible. Adding +1 at numberofRows would solve this problem
Jared have you tried to select the header row twice ? if i select row at first it works fine and when i close the row and then select it again it goes out of order like (cell1,cell2,cell3) becomes (cell3,cell1,cell2,cell3 ) and each time i click it it keeps on expanding . Any one faced this problem , if then help me out
i'm using my custom cell in header section
have the same issue :\
mee too
hi, is it possible to block this action only to some cells?
Hope you guys enjoy this video! What other topics would you like to see? Would love to show some of the background of what goes on in my daily life working on Tag, if you guys are interested. Might reserve that for a second channel thing though... we'll see. :]
Video is taking a while to process to 4K, but it should be coming soon! :]
Great video, 🔥Please make a stripe paid membership period subscription that will allow user to access specific data, I really need help with that ASAP and there is no tutorial about it 👏🏽 stripe + firebase
Please make a video particularly focusing on machine learning,
Firebase oauth
@@informatics3461 Thanks Naveed.
I tried adding an image next to the text and it wouldnt show. How can you make an image appear next to the text for each dropdown?
Hello, great video. thanks for the help. One question, is there a particular reason why you delete the initial viewcontroller and add a tableviewcontroller? instead of adding a tableview to the viewcontroller? thanks
Not him, but it's basically to not have to write boilerplate code for the purpose of this video.
To add a tableView you'd have to either drag it on screen in the storyboard to your viewcontroller and then connect it as an IBOutlet to your file, or manually instantiate it and then add it is a subview to your viewControllers view property. You'd also have to set up it's constraints (programatically or Interface Builder), set the delegate and dataSource of the tableView to your VC, and implement required methods of the dataSource. Or you could roll your own dataSource as a NSObject sucblass that conforms to UITableViewDataSource/UITableViewDelegate.
A subclass of UITableViewController on the other hand already sets up most of this for free, you just have to override UITableViewControllers methods which correspond to the same methods from UITableViewDataSource and UITableViewDelegate protocols.
Jared, I using animation and I’ve more elements (example 50 sections). I open section (example 0 section) and scrolled my table to middle and I opened section 20, that my table jump :(
What if you have section headers each with several expandable cells instead of just one?
hi, excellent tutorial.. can you help if we have more subsection inside SectionData? for example [CellData(opened: false, title: "Title 1", Sectiondata: [["Cell1", "Cell2"],["Cell1"],["Cell1", "Cell2", "Cell3"]
Honestly, those jord watches do look really nice. I just heard about them in this video. I am really picky on watches but these seem to fit my style. Expensive, but great looking!
R3MIX MODZ I get approached by a surprising amount of advertisers, and I try and only pick the best. Saw their website and watches they made and was thrilled to be sponsored by them, haha. Glad you found them cool too! :D
Its nice to see a sponsor that fits your target audience! Keep up the great work!
Wow, what a coincidence! I saw a man wearing jord watch two days ago, and I liked the wood theme. I didn't know what the brand was, but thank you! You answered my question here :)
I tried this with a list of 12 sections long and the closing of cells was not pretty.
thank you very much! the best video i've ever seen. you explain very clearly thank u
how about putting dynamic data inside tableViewData variable in that case we to loop through our data, then how manage cellData inside tableViewData
How would you pass the value for a list item within a heading item. I tried passing the textLabel.text value to the details view and keep getting no value for that.
how to give the color to sections in your code
Means highlight the section
Very helpful video! Well deserved subscription buddy.
Hi Jared, How can I close the previous section when I click row=0 of a new section?
Hey Jared i have a scenario of tableViewCell "How to expand a cell on button click and add a view of desired height on that expanded part in the cell"
Instead of the button in the cell use an image or view that is customised to your likings then use the tableView function of didSelectRowAt: indexPath . As for the height, you may not need to worry about it, just use tableView.rowHeight = UITableView.automaticDimension and it should scale up to match the content inside the cell
Great video! May I get the source code for this tutorial? I'm fairly new. Thank you!
how to show different array of items for each child cell
for eg. sectionData["cell2","cell2","cell3"] sectionData["cell2","cell2","cell3"] sectionData["cell2","cell2","cell3"] -- in your program
but, i want to show the data like this
eg. sectionData1[cell1: "c", cell1:"b", cell3: "c"] sectionData3[cell11: "c", cell12:"b", cell13: "c"] sectionData2[cell21: "c", cell22:"b", cell23: "c"]
how can I retrieve my core data entity's item in the expandable cells instead of static data which is used by you, example cell1,cell2,cell3, thank you in advance
Great vid tuts as always! Cheers Jared!
Very Helpful..but when i click the secon section first expand will be automatically collapse how to do that..?
is it a good practise ?
how can we select the expanded items from this?
I knew it you were LDS...I noticed the collar of your shirt...I greet you from El Salvador...You have a new subscriber. Nice tutorial by the way.
Thank you for not using storyboards
how to add rotation animation in table view cell when it expands ?
Thank you very much! This video helped me a lot!
Hey Jared, awesome video, this helped me a lot!
is there a way to use custom cells with this technique ?
Oh yeah, just switch out my “cell” with your own registered cell identifier. :)
im sorry that i'm asking over and over :) can i use 2 diffrent cells for sub cell and main cell ? i will use the sub cells to show details of some cell data
This Tuto is amazing :) So simple, yet everything works like charm! Thanks and keep up the good work :)
I think the title is a bit misleading. These are expanding sections, not cells, are they not?
Actually, he is not using sections at all.
Yes, it’s sections expanding with rows. Works perfectly I would say 👌
Hey Jared I was literally thinking that, I actually would like to see some background of what you do when working on Tag. Great Idea.
Awesome to hear! I'll think about it some more then. :]
didSelectRowAt indexPath: IndexPath) method is not calling , please help me
is this example code on gitHub?
Can you please make a video on infinite expandable cells?
Hello this worked well for me, thank you! Can anyone tell me how I might go about making the font different for the title vs section data.
Thank You for this video.
Could you share the code?
Does anyone know how to indent the rows that hold the "sectionedData"?
that’s awesome, Jared! I entered the giveaway :) would love a sick watch like that! I’ll have to check out their Apple Watch bands though 😏
Been a watch guy my whole life, but have never really found one I loved & carried around. Usually I just got too sweaty, haha. Was awesome to have them reach out! Wood-watch bands are what I was missing in my life. Plus, it'll be nice to have on my mission! :D Good luck!
Mission like church mission? What church do you go to?
how we can put letest Added data top on tableview ??? hope you Rply me
Can u make tutorial on CoreMl
Beyond me why there's no link to the code.
Nice video . But can you please make a video where scroll in two way direction with some sticky row and column
Sure! Something like the App Store?
Yes
Awesome you are love man you have solved my biggest problems.Thanks for the Vedic
Great video!! Thank you
Can you please make rxswift tutorial
Very useful
Thnku so much
Can someone pls help me .I am trying to delete rows in this tableview
It's really help to me Thax:)
thanks
Can you create video for all docs.swift.org concepts in details .... at 2 to 3 video for each topic . Please..
hey guys! Anyone do this with a UIView container? I need some help about it
can i get the source code please
give me your drop box address
jared thank you so much! a beautiful tutorial!
I have just a question: I implemented your code in a way that you can have just one section open at the time. so when you click to expand a section and there was another that you have expanded before, the app close the previous section opened and it opens the other. here the problem: if I open and close the same section it works perfectly, but if I open another section it crashes with this message: "libc++abi.dylib: terminating with uncaught exception of type NSException".
here you can watch a video with it:
www.dropbox.com/s/99j9d2zjqr4vrcu/video%20of%20error.MOV?dl=0
and here you can find all the project to try it:
www.dropbox.com/sh/i00nlwfp1r3b8a2/AADJvqdGocL-lZJ1-PFBIBB6a?dl=0
please I need help. I don't know if you can add it to the video, or just tell me where I'm making the error. thank you again for your great job.
you can find the post on stack overflow here with more information:
stackoverflow.com/questions/51895695/libcabi-dylib-terminating-with-uncaught-exception-of-type-nsexception-trying
aaaaaah man.. tysm ...
Great video, 🔥Please make a stripe paid membership period subscription that will allow user to access specific data, I really need help with that ASAP and there is no tutorial about it 👏🏽 stripe + firebase
thnx bro...👍🏻
you are great
resolution is too big
I think it is more convenient
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.row == 0 {
data[indexPath.section].isOpened = !data[indexPath.section].isOpened
let section = IndexSet(integer: indexPath.section)
tableView.reloadSections(section, with: .fade)
}
}
#Jord = Soil or Earth in Norwegian
Pronounced “yord”
do you have a flight to catch? i was just wondering why you are talking so fast.
atleast give a link to source code so we can refer it man.....!!!!
At least the source code!! How dare he leaving us alone with a free tutorial?
Hai ,My Json dict is as follows
After decoding of Json, How to get this details in a single tableview ,any one help me
How can i create json module also
thanks!
[{"StudentID":2451,"ClassID":49,"SectionID":404,"Total":75.0,"Percentage":62.5,"Result":"PASS","RankGrade":"D","subjectmarks":[{"SubjectID":158,"SubjectCode":"TAM","SubjectName":"TAMIL","Mark":4.5},{"SubjectID":159,"SubjectCode":"ENG","SubjectName":"ENGLISH","Mark":8.5},{"SubjectID":160,"SubjectCode":"HIN","SubjectName":"HINDI","Mark":15.0},{"SubjectID":161,"SubjectCode":"MAT","SubjectName":"MATHS","Mark":12.5},{"SubjectID":165,"SubjectCode":"SCE","SubjectName":"SCEINCE","Mark":17.0},{"SubjectID":166,"SubjectCode":"SOC","SubjectName":"SOCIAL SCIENCE","Mark":17.5}],... }]
plz answer me
First
Eyy, nice! :D
Hi master a question, how can I change the background color of the cell when it happens to be a section?