I'm getting the data from api' like below i want show in tableview with expandable with title subitems> subitems
{
"CategoryId": "25",
"Name": "Bathroom Furniture",
"ParentID": "0",
"cPath": "25",
"level": 0,
"SubItems": [
{
"CategoryId": "43",
"Name": "Bathroom Cabinets",
"ParentID": "25",
"cPath": "25_43",
"level": 1,
"SubItems": []
},
{
"CategoryId": "44",
"Name": "Bathroom Mirrors",
"ParentID": "25",
"cPath": "25_44",
"level": 1,
"SubItems": []
},
{
"CategoryId": "45",
"Name": "Bathroom Storage Units",
"ParentID": "25",
"cPath": "25_45",
"level": 1,
"SubItems": []
},
{
"CategoryId": "209",
"Name": "Bathroom Vanities",
"ParentID": "25",
"cPath": "25_209",
"level": 1,
"SubItems": []
},
{
"CategoryId": "42",
"Name": "Bathroom Furniture Sets",
"ParentID": "25",
"cPath": "25_42",
"level": 1,
"SubItems": []
},
{
"CategoryId": "37",
"Name": "Toilet Seats",
"ParentID": "25",
"cPath": "25_37",
"level": 1,
"SubItems": []
},
{
"CategoryId": "41",
"Name": "Bathroom Accessories",
"ParentID": "25",
"cPath": "25_41",
"level": 1,
"SubItems": []
},
{
"CategoryId": "40",
"Name": "Bathroom Bins",
"ParentID": "25",
"cPath": "25_40",
"level": 1,
"SubItems": []
}
]
}

Demo code for your problem
PseudoHeaderTableViewCell Class code:
Storyboard UI :
For reference : https://medium.com/@legonaftik/uitableview-with-collapsible-sections-927d726b985c .