Table View with sticky header or multiple layouts

I will explain code for Xamarin(iOS) in C# but relatable to native iOS

List<StickyHeaderModel> list = new List<StickyHeaderModel>();
for(int i=0;i<5;i++){
list.add(new HeaderMode("Date"+i));
for(int j=0;j<5;j++){
list.add(new ContentModel("Date"+i,"Hii this is content
for header"+i+"content"+j));
You can also take list of 'any' type

In the above list “HeaderModel” will be used for displaying headers and “ContentModel” will be used for displaying description
also, “ContentModel” contains date , because it will keep track about which content is contained under which header (as you can see in above list that i have added date of its header )

Below “contentcell” is used to display description part and “headercell” is used to display headers (or date according to my list)
“lblHeader” is label which I have taekn at top of tableview

In “GetCell” method in tableviewsource, I will inflate “headercell” if data at that position in list is headermodel and “contentcell” if data at that position is contentmodel

I will initially hide “lblHeader” as initally our table view will show correct list with proper sections

Now, whenever tableview is scrolled , then I will check if cell visible at top is not a header cell or if it is header cell but not completely visible then I will show “lblHeader” and set date of item visible at top of table view(as I have kept date at every item of my list)
Also if on scrolling if cell at top is header cell and visible completely then I will hide my “lblHeader”
Logic for stickyHeader is written in “onScrolled”

Application Developer (Android, Xamarin)